diff options
author | Franck Cuny <franck@fcuny.net> | 2022-02-10 17:46:13 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-02-10 17:46:13 -0800 |
commit | 446f2ac62e23507dc704471987388382fb238f6d (patch) | |
tree | e1633b73183d64ae80fd37ded28a4dbe3c4db193 /flake.nix | |
parent | home-manager: fix mpd config (diff) | |
download | world-446f2ac62e23507dc704471987388382fb238f6d.tar.gz |
home-manager: split the configuration
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/flake.nix b/flake.nix index 750c21a..e792668 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,5 @@ { description = "personal NixOS configurations"; - inputs = { # Nixpkgs, NixOS's official repo nixpkgs.url = "github:nixos/nixpkgs/release-21.11"; @@ -16,20 +15,36 @@ }; # Output config, or config for NixOS system - outputs = { self, nixpkgs, home-manager, ... }@inputs: { - nixosConfigurations = { - # desktop - carmel = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./hosts/carmel/configuration.nix - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.fcuny = import ./users/fcuny/desktop.nix; - } - ]; + outputs = { ... }@inputs: + let + lib = import ./lib { inherit inputs; }; + in: { + nixosConfigurations = { + carmel = lib.mkSystem { + hostname = "carmel"; + system = "x86_64-linux"; + desktop = true; + }; }; - }; - }; + + homeConfigurations = { + "fcuny@carmel" = lib.mkHome { + username = "fcuny"; + system = "x86_64-linux"; + hostname = "carmel"; + desktop = true; + }; + }; + } // inputs.utils.lib.eachDefaultSystem (system: + let + pkgs = import inputs.nixpkgs { inherit system overlays; }; + home-manager = inputs.home-manager.defaultPackage."${system}"; + in + { + packages = pkgs // { inherit home-manager; }; + + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ nixUnstable nixfmt rnix-lsp home-manager git ]; + }; + }); } |