From 93b0545d11bf8c7f065203f7f3eaf1d0e3730dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 21 Feb 2022 21:54:09 +0100 Subject: Add initial version --- flake.nix | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d39fbff --- /dev/null +++ b/flake.nix @@ -0,0 +1,80 @@ +{ + description = "Cynerd's personal flake"; + + inputs = { + shellrc.url = "git+https://git.cynerd.cz/shellrc"; + nixturris.url = "git+https://git.cynerd.cz/nixturris"; + personal-secret.url = "git+ssh://git@cynerd.cz/nixos-personal-secret"; + + #sterm.url = "github:wentasah/sterm"; + sterm.url = "github:cynerd/sterm/comp"; + }; + + outputs = { self + , nixpkgs, flake-utils + , shellrc, nixturris, personal-secret + , sterm + }: + with flake-utils.lib; + { + overlays.default = final: prev: import ./pkgs { nixpkgs = prev; }; + nixosModules = import ./nixos nixpkgs; + + nixosConfigurations = let + + modules = hostname: [ + self.nixosModules.default + self.nixosModules."machine-${hostname}" + shellrc.nixosModule + (personal-secret.lib.personalSecrets hostname) + { + networking.hostName = hostname; + nixpkgs.overlays = [ + self.overlays.default + sterm.overlay + ]; + } + ]; + + genericSystem = system: hostname: { + ${hostname} = nixpkgs.lib.nixosSystem { + system = system; + modules = modules hostname; + }; + }; + amd64System = genericSystem "x86_64-linux"; + armv7lSystem = genericSystem "armv7l-linux"; + aarch64System = genericSystem "aarch64-linux"; + + turrisSystem = board: hostname: { + ${hostname} = nixturris.lib.nixturrisSystem { + nixpkgs = nixpkgs; + board = board; + modules = modules hostname; + }; + }; + turrisMoxSystem = turrisSystem "mox"; + turrisOmniaSystem = turrisSystem "omnia"; + + in + amd64System "albert" // + amd64System "binky" // + amd64System "errol" // + amd64System "lipwig" // + amd64System "ridcully" // + amd64System "susan" // + armv7lSystem "spt-mpd" // + aarch64System "adm-mpd" // + turrisOmniaSystem "spt-omnia" // + turrisMoxSystem "spt-mox" // + turrisMoxSystem "spt-mox2" // + turrisOmniaSystem "adm-omnia" // + turrisOmniaSystem "adm-omnia2"; + + } // eachDefaultSystem (system: { + packages = filterPackages system (flattenTree ( + import ./pkgs { nixpkgs = nixpkgs.legacyPackages."${system}"; } + )); + }); + +} -- cgit v1.2.3