Add home-manager

This commit is contained in:
Torjus Håkestad 2024-02-27 09:58:20 +01:00
parent 78992b130b
commit 7410af0502
6 changed files with 55 additions and 3 deletions

View File

@ -1,5 +1,25 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1708988456,
"narHash": "sha256-RCz7Xe64tN2zgWk+MVHkzg224znwqknJ1RnB7rVqUWw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "1d085ea4444d26aa52297758b333b449b2aa6fca",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1708807242,
@ -18,6 +38,7 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}

View File

@ -3,6 +3,10 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs:

20
home/default.nix Normal file
View File

@ -0,0 +1,20 @@
{ inputs, self, user, ...}: {
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs= true;
extraSpecialArgs = { inherit inputs user; };
users.${user} = {
imports = [
./programs/firefox
];
firefox.enable = true;
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
};
};
}

View File

@ -0,0 +1,9 @@
{ pkgs, config, lib, inputs, user, ...}: {
options.firefox.enable = lib.mkEnableOption "Firefox";
config = lib.mkIf config.firefox.enable {
programs.firefox = {
enable = true;
};
};
}

View File

@ -3,5 +3,6 @@
./configuration.nix
./hardware-configuration.nix
../../system
../../home
];
}

View File

@ -13,9 +13,6 @@
extraGroups = [ "wheel" "networkmanager" ];
# Install some user packages
packages = with pkgs; [
# Browser
firefox
# Editors
vscode