diff options
author | Emile <git@emile.space> | 2024-09-19 10:48:16 +0200 |
---|---|---|
committer | Emile <git@emile.space> | 2024-09-19 10:48:16 +0200 |
commit | e833c13c177288b2a7b9168a784e0e6562c025b6 (patch) | |
tree | 1661dad1694989e2d83e6c2fca7b5602a61c574b /flake.nix | |
parent | dcde3882d5460368e3c0499a54330f84a6995d62 (diff) |
big format using nixfmt
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 323 |
1 files changed, 170 insertions, 153 deletions
diff --git a/flake.nix b/flake.nix index 0b48f3f..cfaf941 100644 --- a/flake.nix +++ b/flake.nix @@ -27,170 +27,187 @@ hefe-internal.url = "git+ssh://git@git.emile.space/hefe-internal"; }; - outputs = { - self, - nixpkgs, nixpkgs-unstable, # general packages - darwin, # darwin related stuff - deploy-rs, # deploy the hosts - agenix, # store secrets crypted using age - home-manager, # manage my home envs - naersk, # build rust stuff - hefe-internal, # internal tooling - ... }@inputs: - let - lib = import ./nix/lib inputs; - helper = lib.flake-helper; - in { - - hosts = { - caladan = { - system = "aarch64-darwin"; - sshUser = "hydra"; - homeManagerEnable = true; - description = "macbook air"; - # nix run https://github.com/LnL7/nix-darwin/archive/master.tar.gz -- switch --flake .#caladan - }; - corrino = { - system = "x86_64-linux"; - ip = "corrino"; - description = "Hetzner AX41 dual 512GB NVME"; - modules = [ hefe-internal.nixosModules.corrino ]; - }; - chusuk = { - # ip = "chusuk.pinto-pike.ts.net"; - system = "x86_64-linux"; - description = "lenovo t480"; - }; - hacknix = { - # ip = "hacknix.pinto-pike.ts.net"; # clone repo and deploy within - system = "x86_64-linux"; - description = "hacking vm"; - }; - mail = { - # ip = "mail.pinto-pike.ts.net"; # clone repo and deploy within - system = "x86_64-linux"; - description = "mail server"; - }; + outputs = + { + self, + nixpkgs, + nixpkgs-unstable, # general packages + darwin, # darwin related stuff + deploy-rs, # deploy the hosts + agenix, # store secrets crypted using age + home-manager, # manage my home envs + naersk, # build rust stuff + hefe-internal, # internal tooling + ... + }@inputs: + let + lib = import ./nix/lib inputs; + helper = lib.flake-helper; + in + { + + hosts = { + caladan = { + system = "aarch64-darwin"; + sshUser = "hydra"; + homeManagerEnable = true; + description = "macbook air"; + # nix run https://github.com/LnL7/nix-darwin/archive/master.tar.gz -- switch --flake .#caladan + }; + corrino = { + system = "x86_64-linux"; + ip = "corrino"; + description = "Hetzner AX41 dual 512GB NVME"; + modules = [ hefe-internal.nixosModules.corrino ]; + }; + chusuk = { + # ip = "chusuk.pinto-pike.ts.net"; + system = "x86_64-linux"; + description = "lenovo t480"; + }; + hacknix = { + # ip = "hacknix.pinto-pike.ts.net"; # clone repo and deploy within + system = "x86_64-linux"; + description = "hacking vm"; + }; + mail = { + # ip = "mail.pinto-pike.ts.net"; # clone repo and deploy within + system = "x86_64-linux"; + description = "mail server"; + }; - #kolhar = {}; # nixos vm on caladan - #hagal = {}; # apple tv - - lampadas = { - system = "x86_64-linux"; # 4c4t (intel n100), 32GB RAM - description = "NAS"; - }; - # palma = { - # description = "palma bmc"; - # }; + #kolhar = {}; # nixos vm on caladan + #hagal = {}; # apple tv - lernaeus = { - system = "x86_64-linux"; # 8c16t (AMD ryzen 5 5600g), 32GB RAM - description = "VM Host"; + lampadas = { + system = "x86_64-linux"; # 4c4t (intel n100), 32GB RAM + description = "NAS"; + }; + # palma = { + # description = "palma bmc"; + # }; + + lernaeus = { + system = "x86_64-linux"; # 8c16t (AMD ryzen 5 5600g), 32GB RAM + description = "VM Host"; + }; + # parmentier = { + # description = "lernaeus bmc"; + # }; + + # lankiveil = { + # system = "x86_64-linux"; # ???, ???, RTX A2000 + # description = ""; + # }; + # poritrin = { + # description = "lankiveil bmc"; + # }; + + # kaitain = {}; + # ecaz = {}; + # gamont = {}; + + # futher names: https://neoencyclopedia.fandom.com/wiki/List_of_Dune_planets + # Muritan + # Naraj + # Palma + # Parmentier + # Poritrin + # Richese + # Romo + # Rossak + # Sikun + # Synchrony + # Tleilax + # Tupile + # Zanovar }; - # parmentier = { - # description = "lernaeus bmc"; - # }; - - # lankiveil = { - # system = "x86_64-linux"; # ???, ???, RTX A2000 - # description = ""; - # }; - # poritrin = { - # description = "lankiveil bmc"; - # }; - - # kaitain = {}; - # ecaz = {}; - # gamont = {}; - - # futher names: https://neoencyclopedia.fandom.com/wiki/List_of_Dune_planets - # Muritan - # Naraj - # Palma - # Parmentier - # Poritrin - # Richese - # Romo - # Rossak - # Sikun - # Synchrony - # Tleilax - # Tupile - # Zanovar - }; - nixosConfigurations = helper.mapToNixosConfigurations self.hosts; - darwinConfigurations = helper.mapToDarwinConfigurations self.hosts; + nixosConfigurations = helper.mapToNixosConfigurations self.hosts; + darwinConfigurations = helper.mapToDarwinConfigurations self.hosts; - nixosModules = { - x86_64-linux = import ./nix/modules/x86_64-linux.nix; - default = self.nixosModules.x86_64-linux; - }; + nixosModules = { + x86_64-linux = import ./nix/modules/x86_64-linux.nix; + default = self.nixosModules.x86_64-linux; + }; - overlays = { - emile = import ./nix/pkgs/overlay.nix; - default = self.overlays.x86_64-linux; - unstable = final: prev: { - unstable = import nixpkgs-unstable { - system = "x86_64-linux"; - config.allowUnfree = true; + overlays = { + emile = import ./nix/pkgs/overlay.nix; + default = self.overlays.x86_64-linux; + unstable = final: prev: { + unstable = import nixpkgs-unstable { + system = "x86_64-linux"; + config.allowUnfree = true; + }; }; }; - }; - deploy.nodes = helper.mapToDeployRsConfiguration self.hosts; - deploy.autoRollback = true; - - packages = - nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-darwin" ] (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ - - (if system == "x86_64-linux" then self.overlays.x86_64-linux - else if system == "aarch64-darwin" then self.overlays.aarch64-darwin - else null) - # self.overlays.emile - - # some arguments for packages - (_: _: { inherit naersk; }) - ]; + deploy.nodes = helper.mapToDeployRsConfiguration self.hosts; + deploy.autoRollback = true; + + packages = + nixpkgs.lib.genAttrs + [ + "x86_64-linux" + "aarch64-darwin" + ] + ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ + + ( + if system == "x86_64-linux" then + self.overlays.x86_64-linux + else if system == "aarch64-darwin" then + self.overlays.aarch64-darwin + else + null + ) + # self.overlays.emile + + # some arguments for packages + (_: _: { inherit naersk; }) + ]; + }; + in + { + inherit (pkgs) + vokobe + r2wars-web + # emu-riscv + # emu-mips + # emu-x86_64 + ; + } + ); + + hydraJobs = { + inherit (self) packages; + nixosConfigurations = helper.buildHosts self.nixosConfigurations; }; - in { - inherit (pkgs) - vokobe - r2wars-web - # emu-riscv - # emu-mips - # emu-x86_64 - ; - }); - - hydraJobs = { - inherit (self) packages; - nixosConfigurations = helper.buildHosts self.nixosConfigurations; - }; - templates = { - # ; nix nix registry add hefe /Users/emile/Documents/hefe - # ; nix flake init -t hefe#ctf - ctf = { - description = "A basic ctf env with pwn, rev, ... tools"; - path = ./nix/templates/ctf; - welcomeText = '' - # A basic CTF env - ## Intended usage - The intended usage of this flake is... - - ## More info - - [Rust language](https://www.rust-lang.org/) - - [Rust on the NixOS Wiki](https://nixos.wiki/wiki/Rust) - - ... - ''; + templates = { + # ; nix nix registry add hefe /Users/emile/Documents/hefe + # ; nix flake init -t hefe#ctf + ctf = { + description = "A basic ctf env with pwn, rev, ... tools"; + path = ./nix/templates/ctf; + welcomeText = '' + # A basic CTF env + ## Intended usage + The intended usage of this flake is... + + ## More info + - [Rust language](https://www.rust-lang.org/) + - [Rust on the NixOS Wiki](https://nixos.wiki/wiki/Rust) + - ... + ''; + }; }; - }; - # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; - }; + # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; + }; } |