diff options
author | Alan Pearce | 2024-10-31 16:49:01 +0100 |
---|---|---|
committer | Alan Pearce | 2024-11-02 13:39:34 +0100 |
commit | c0384c43821474d28af1d9696ceb473a0d769292 (patch) | |
tree | 4fed9f5175f02d36e0e58c4e93469c3705b085de /flake.nix | |
parent | 365c0df92f6e8c59a0e0c38eabae1ba6f35d129d (diff) | |
download | nixfiles-c0384c43821474d28af1d9696ceb473a0d769292.tar.lz nixfiles-c0384c43821474d28af1d9696ceb473a0d769292.tar.zst nixfiles-c0384c43821474d28af1d9696ceb473a0d769292.zip |
This reverts commits: - 66e56cb0e1c95202133733c0812b794171dc73c5. - 3fae7d35d9b32ab3c4f7293c418167a52aff8717. - 417a1ce6481adfc713d8d0d6ad03e211a3d0eb22. - 6b4469a98d7b2d88a3442b1051174000538199f0.
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..564b5006 --- /dev/null +++ b/flake.nix @@ -0,0 +1,156 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-small.url = "github:NixOS/nixpkgs/nixos-unstable-small"; + 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"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + secrets = { + flake = false; + }; + utils.url = "github:numtide/flake-utils"; + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; + personal = { + url = "git+https://git.alanpearce.eu/nix-packages"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + searchix = { + url = "git+https://git.alanpearce.eu/searchix"; + inputs.nixpkgs.follows = "nixpkgs-small"; + }; + golink = { + url = "github:tailscale/golink"; + inputs.nixpkgs.follows = "nixpkgs-small"; + }; + }; + + outputs = + inputs@ + { self + , utils + , nixpkgs + , nixpkgs-small + , nixos-hardware + , home-manager + , darwin + , nix-index-database + , secrets + , agenix + , personal + , 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) ++ [ + (self: super: { + personal = personal.packages.${system}; + 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.nanopi = nixpkgs-small.lib.nixosSystem { + system = utils.lib.system.aarch64-linux; + specialArgs = { inherit inputs; }; + modules = [ + agenix.nixosModules.default + ./system/nanopi.nix + ]; + }; + nixosConfigurations.linde = nixpkgs-small.lib.nixosSystem { + system = utils.lib.system.aarch64-linux; + specialArgs = { inherit inputs; }; + modules = [ + agenix.nixosModules.default + searchix.nixosModules.web + golink.nixosModules.default + ./system/linde.nix + ]; + }; + darwinConfigurations.mba = darwin.lib.darwinSystem { + system = utils.lib.system.aarch64-darwin; + specialArgs = { inherit inputs; }; + modules = [ + ./system/mba.nix + personal.darwinModules.caddy + ]; + }; + homeConfigurations."alan@mba" = mkHomeConfiguration { + system = utils.lib.system.aarch64-darwin; + modules = [ + ./user/mba.nix + nix-index-database.hmModules.nix-index + (secrets + "/default.nix") + (secrets + "/ssh.nix") + ]; + }; + homeConfigurations."alan@prefect" = mkHomeConfiguration { + system = utils.lib.system.x86_64-linux; + modules = [ + ./user/prefect.nix + nix-index-database.hmModules.nix-index + (secrets + "/default.nix") + (secrets + "/ssh.nix") + ]; + }; + homeConfigurations."alan@nanopi" = mkHomeConfiguration { + system = utils.lib.system.aarch64-linux; + modules = [ + ./user/nanopi.nix + nix-index-database.hmModules.nix-index + (secrets + "/default.nix") + ]; + }; + homeConfigurations."alan@linde" = mkHomeConfiguration { + system = utils.lib.system.aarch64-linux; + modules = [ + ./user/server.nix + nix-index-database.hmModules.nix-index + (secrets + "/default.nix") + ]; + }; + }; +} |