nix/flake.nix
2023-12-15 21:45:08 +09:00

54 lines
No EOL
3.3 KiB
Nix

{
description = "NixOS System Config";
inputs = import ./inputs.nix;
outputs = { self, nixpkgs, nixpkgs-wayland, home-manager, lanzaboote, nur, sops-nix, doom-emacs, nixos-generators, deploy-rs, ... } @inputs:
let
inherit (self) outputs;
stateVersion = "23.11";
hmStateVersion = "23.11";
libx = import ./lib { inherit self inputs outputs stateVersion hmStateVersion; };
in {
nixosConfigurations = {
osaka-linode-01 = libx.mkHost { hostname = "osaka-linode-01"; type = "small"; };
nixos-vm-01 = libx.mkHost { hostname = "nixos-vm-01"; };
framework-server = libx.mkHost { hostname = "framework-server"; };
# nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; desktop = "gnome"; gpu = "nvidia"; };
# nixos-framework = libx.mkHost { hostname = "nixos-framework"; desktop = "hyprland"; gpu = "amd"; theme = "green"; };
backups-rpi4 = libx.mkHost { hostname = "backups-rpi4"; platform = "aarch64-linux"; type = "small"; };
piaware-rpi4 = libx.mkHost { hostname = "piaware-rpi4"; platform = "aarch64-linux"; type = "small"; };
};
homeConfigurations = {
"albert@osaka-linode-01" = libx.mkHome { hostname = "osaka-linode-01"; };
"albert@nixos-vm-01" = libx.mkHome { hostname = "nixos-vm-01"; };
"albert@framework-server" = libx.mkHome { hostname = "framework-server"; };
# "albert@nixos-desktop" = libx.mkHome { hostname = "nixos-desktop"; desktop = "gnome"; };
# "albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "green"; };
"albert@backups-rpi4" = libx.mkHome { hostname = "backups-rpi4"; platform = "aarch64-linux"; type = "small"; };
"albert@piaware-rpi4" = libx.mkHome { hostname = "piaware-rpi4"; platform = "aarch64-linux"; type = "small"; };
};
deploy.nodes = {
osaka-linode-01 = libx.deploy { hostname = "osaka-linode-01"; };
nixos-vm-01 = libx.deploy { hostname = "nixos-vm-01"; };
framework-server = libx.deploy { hostname = "framework-server"; };
# nixos-desktop = libx.deploy { hostname = "nixos-desktop"; };
# nixos-framework = libx.deploy { hostname = "nixos-framework"; };
backups-rpi4 = libx.deploy { hostname = "backups-rpi4"; platform = "aarch64-linux"; };
piaware-rpi4 = libx.deploy { hostname = "piaware-rpi4"; platform = "aarch64-linux"; };
};
imageConfigurations = {
nixos-linode-img = libx.mkMinImage { hostname = "nixos-linode-img"; format = "linode"; };
nixos-rpi4-img = libx.mkImage { hostname = "nixos-rpi4-img"; format = "sd-aarch64"; platform = "aarch64-linux"; };
nixos-iso-console = libx.mkImage { hostname = "nixos-iso-console"; format = "iso"; };
nixos-iso-desktop = libx.mkImage { hostname = "nixos-iso-desktop"; format = "iso"; desktop = "gnome"; };
};
# Checks for deploy-rs - Makes deploy-rs fail when system evaluations fail
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
# Devshell for bootstrapping; acessible via 'nix develop'
devShells = libx.forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./shell.nix { inherit pkgs sops-nix deploy-rs system; }
);
};
}