diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-08-08 05:11:59 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-08-08 05:11:59 -0600 |
| commit | 45d079d445bb3d6c2df4e3c99349677eed78010b (patch) | |
| tree | 722a9c2a17a478467c30e9b5f3f98b588a5398e7 /flake.nix | |
| parent | f74c0f26e887467f1edd3bda5f03da3786180eb3 (diff) | |
sys: implement primitive impermanence
Diffstat (limited to '')
| -rw-r--r-- | flake.nix | 83 |
1 files changed, 43 insertions, 40 deletions
@@ -9,55 +9,58 @@ }; nur.url = "github:nix-community/NUR"; + impermanence.url = "github:nix-community/impermanence"; }; - outputs = { self, nixpkgs, nixpkgsUnstable, home-manager, nur, ... }: with nixpkgs.lib; let - util = import ./util; - inherit (util nixpkgs.lib) importAll; + outputs = + { self, nixpkgs, nixpkgsUnstable, home-manager, nur, impermanence, ... }: + with nixpkgs.lib; let + util = import ./util; + inherit (util nixpkgs.lib) importAll; - pkgSet = pkgs: import ./pkgs { - inherit pkgs; - util = util pkgs.lib; - }; - in { - packages."x86_64-linux" = pkgSet nixpkgs.legacyPackages."x86_64-linux"; - - overlay = self: super: { - local = pkgSet super; - unstable = import nixpkgsUnstable { inherit (super) config system; }; - }; + pkgSet = pkgs: import ./pkgs { + inherit pkgs; + util = util pkgs.lib; + }; + in { + packages."x86_64-linux" = pkgSet nixpkgs.legacyPackages."x86_64-linux"; - nixosConfigurations = let - hostConfig = host: (makeOverridable nixosSystem) { - system = "x86_64-linux"; - modules = [ (import ./sys { inherit self; }) host ]; + overlay = self: super: { + local = pkgSet super; + unstable = import nixpkgsUnstable { inherit (super) config system; }; }; - in mapAttrs (_: hostConfig) (importAll { root = ./sys/platform; }); - homeConfigurations = let - home = platform: home-manager.lib.homeManagerConfiguration { - system = "x86_64-linux"; + nixosConfigurations = let + hostConfig = host: (makeOverridable nixosSystem) { + system = "x86_64-linux"; + modules = [ (import ./sys { inherit self impermanence; }) host ]; + }; + in mapAttrs (_: hostConfig) (importAll { root = ./sys/platform; }); - configuration = import ./home { inherit self nixpkgs nixpkgsUnstable nur; }; - extraModules = [ platform ]; + homeConfigurations = let + home = platform: home-manager.lib.homeManagerConfiguration { + system = "x86_64-linux"; - username = "ale"; - homeDirectory = "/home/ale"; + configuration = import ./home { inherit self nixpkgs nixpkgsUnstable nur; }; + extraModules = [ platform ]; - # Update the state version as needed. - # See the changelog here: - # https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05 - stateVersion = "21.11"; + username = "ale"; + homeDirectory = "/home/ale"; - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix - extraSpecialArgs = {}; - }; + # Update the state version as needed. + # See the changelog here: + # https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05 + stateVersion = "21.11"; - homeConfig = id: platform: { - name = "ale@${id}"; - value = home platform; - }; - in mapAttrs' homeConfig (importAll { root = ./home/platform; }); - }; + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = {}; + }; + + homeConfig = id: platform: { + name = "ale@${id}"; + value = home platform; + }; + in mapAttrs' homeConfig (importAll { root = ./home/platform; }); + }; } |
