all repos — nixfiles @ 93dba07db6a1db2d7d84adf56da0f9cc2d31bc81

System and user configuration, managed by nix and home-manager

Switch back to flakes (again) This reverts commit b5bcdf72cbc998550bf55af1842fe65f8c9ef0bf.

Alan Pearce
commit

93dba07db6a1db2d7d84adf56da0f9cc2d31bc81

parent

0996780254c9d819f0a8be3a63b643ad11dc66be

1 file changed, 218 insertions(+), 0 deletions(-)

changed files
A flake.nix
@@ -0,0 +1,218 @@
+{ + inputs = { + srvos.url = "github:nix-community/srvos"; + nixpkgs.follows = "srvos/nixpkgs"; + nixos-hardware.url = "github:NixOS/nixos-hardware"; + nix-index-database.url = "github:Mic92/nix-index-database"; + nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; + darwin.url = "github:lnl7/nix-darwin/master"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; + emacs-overlay.url = "github:nix-community/emacs-overlay"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + utils.url = "github:numtide/flake-utils"; + angrr.url = "github:linyinfeng/angrr"; + angrr.inputs.nixpkgs.follows = "nixpkgs"; + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; + deploy-rs.url = "github:serokell/deploy-rs"; + mycal.url = "git+https://git.alin.ovh/mycal"; + elgit.url = "git+https://git.alin.ovh/elgit"; + searchix.url = "git+https://git.alin.ovh/searchix"; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + golink = { + url = "github:tailscale/golink"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + inputs@ + { self + , utils + , srvos + , nixpkgs + , nixos-hardware + , emacs-overlay + , home-manager + , darwin + , nix-index-database + , nixvim + , angrr + , agenix + , deploy-rs + , elgit + , mycal + , searchix + , golink + , ... + }: + let + readOverlays = path: + let content = builtins.readDir path; in + map (n: import (path + ("/" + n))) + (builtins.filter + (n: + (builtins.match ".*\\.nix" n != null && + # ignore Emacs lock files (.#foo.nix) + builtins.match "\\.#.*" n == null) || + builtins.pathExists (path + ("/" + n + "/default.nix"))) + (builtins.attrNames content)); + + mkHomeConfiguration = { modules, system }: home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { + inherit system; + overlays = readOverlays (toString ./overlays) ++ [ + agenix.overlays.default + angrr.overlays.default + emacs-overlay.overlays.default + (self: super: { + personal = import ./packages/overlay.nix self super; + enchant = super.enchant.override { + withHspell = false; + withAspell = false; + }; + }) + ]; + }; + + inherit modules; + extraSpecialArgs = { + inherit inputs system; + }; + }; + in + { + nixosConfigurations.prefect = nixpkgs.lib.nixosSystem { + system = utils.lib.system.x86_64-linux; + specialArgs = { inherit inputs; }; + modules = [ + ./system/prefect.nix + ] ++ (with nixos-hardware.nixosModules; [ + common-cpu-amd + common-cpu-amd-pstate + common-pc-ssd + common-pc + common-gpu-nvidia-nonprime + ]); + }; + nixosConfigurations.nano = nixpkgs.lib.nixosSystem { + system = utils.lib.system.aarch64-linux; + specialArgs = { inherit inputs; }; + modules = [ + agenix.nixosModules.default + srvos.nixosModules.server + srvos.nixosModules.mixins-systemd-boot + ./system/nano.nix + ./system/nano-hardware.nix + ]; + }; + nixosConfigurations.linde = nixpkgs.lib.nixosSystem { + system = utils.lib.system.aarch64-linux; + specialArgs = { inherit inputs; }; + modules = [ + srvos.nixosModules.server + srvos.nixosModules.hardware-hetzner-cloud-arm + agenix.nixosModules.default + elgit.nixosModules.default + mycal.nixosModules.default + searchix.nixosModules.web + golink.nixosModules.default + ./packages/modules/nixos/laminar.nix + ./system/linde.nix + ]; + }; + darwinConfigurations.marvin = darwin.lib.darwinSystem { + system = utils.lib.system.aarch64-darwin; + specialArgs = { inherit inputs; }; + modules = [ + srvos.darwinModules.desktop + ./system/marvin.nix + ./packages/modules/darwin/caddy + ]; + }; + homeConfigurations."alan@marvin" = mkHomeConfiguration { + system = utils.lib.system.aarch64-darwin; + modules = [ + ./user/marvin.nix + ./private/tabnine.nix + ./private/ssh.nix + nix-index-database.hmModules.nix-index + nixvim.homeModules.nixvim + ]; + }; + homeConfigurations."alan@prefect" = mkHomeConfiguration { + system = utils.lib.system.x86_64-linux; + modules = [ + ./user/prefect.nix + ./private/tabnine.nix + ./private/ssh.nix + nix-index-database.hmModules.nix-index + ]; + }; + homeConfigurations."alan@nano" = mkHomeConfiguration { + system = utils.lib.system.aarch64-linux; + modules = [ + ./user/nano.nix + nix-index-database.hmModules.nix-index + ]; + }; + homeConfigurations."alan@linde" = mkHomeConfiguration { + system = utils.lib.system.aarch64-linux; + modules = [ + ./user/server.nix + nix-index-database.hmModules.nix-index + ]; + }; + + deploy = { + nodes.linde = { + hostname = "linde"; + profiles.system = { + user = "root"; + sshUser = "root"; + path = deploy-rs.lib.${utils.lib.system.aarch64-linux}.activate.nixos + self.nixosConfigurations.linde; + }; + profiles.alan = { + user = "alan"; + path = deploy-rs.lib.${utils.lib.system.aarch64-linux}.activate.home-manager + self.homeConfigurations."alan@linde"; + }; + }; + nodes.nano = { + hostname = "nano"; + profiles.system = { + user = "root"; + sshUser = "root"; + path = deploy-rs.lib.${utils.lib.system.aarch64-linux}.activate.nixos + self.nixosConfigurations.nano; + }; + profiles.alan = { + user = "alan"; + sshUser = "alan"; + path = deploy-rs.lib.${utils.lib.system.aarch64-linux}.activate.home-manager + self.homeConfigurations."alan@nano"; + }; + }; + }; + } // utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells = { + default = pkgs.mkShell { + packages = with pkgs; [ + home-manager + colmena + deploy-rs.packages.${system}.default + agenix.packages.${system}.default + ]; + }; + }; + }); +}