diff --git a/flake.lock b/flake.lock index 35019b6..e8c9dfc 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1699368917, + "narHash": "sha256-nUtGIWf86BOkUbtksWtfglvCZ/otP0FTZlQH8Rzc7PA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "6a8444467c83c961e2f5ff64fb4f422e303c98d3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1699099776, @@ -50,6 +70,7 @@ }, "root": { "inputs": { + "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable" diff --git a/flake.nix b/flake.nix index 42308f3..428a572 100644 --- a/flake.nix +++ b/flake.nix @@ -5,27 +5,42 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = inputs@{ nixpkgs, ... }: { + outputs = inputs@{ nixpkgs, home-manager, ... }: let + system = "x86_64-linux"; + nixSettings = { config, lib, pkgs, ... }: { + # Setting each of the flake inputs as part of the system registry + # including our own flake which is just renamed from "self" to + # "config". + nix.registry = + lib.mapAttrs' + (name: flake: + let + name' = if (name == "self") then "config" else name; + in + lib.nameValuePair name' { inherit flake; }) + inputs; + }; + in + { nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ({ config, lib, pkgs, ... }: { - # Setting each of the flake inputs as part of the system registry - # including our own flake which is just renamed from "self" to - # "config". - nix.registry = - lib.mapAttrs' - (name: flake: - let - name' = if (name == "self") then "config" else name; - in - lib.nameValuePair name' { inherit flake; }) - inputs; - }) + nixSettings ./hosts/desktop ]; }; + + homeConfigurations.foodogsquared = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.${system}; + modules = [ + nixSettings + ./users/foodogsquared + ]; + }; }; } diff --git a/users/foodogsquared/default.nix b/users/foodogsquared/default.nix new file mode 100644 index 0000000..56a10c5 --- /dev/null +++ b/users/foodogsquared/default.nix @@ -0,0 +1,6 @@ +{ config, lib, pkgs, ... }: + +{ + programs.home-manager.enable = true; + home.stateVersion = "23.11"; +}