diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | flake.lock | 50 | ||||
| -rw-r--r-- | flake.nix | 14 | ||||
| -rw-r--r-- | justfile | 43 | ||||
| -rw-r--r-- | systems/atlas/default.nix | 8 | ||||
| -rw-r--r-- | systems/default.nix | 6 | ||||
| -rw-r--r-- | systems/deploy.nix | 44 |
7 files changed, 64 insertions, 103 deletions
@@ -37,7 +37,7 @@ there are some amazing tools i use to make/manage this flake that i would highly - [home-manager](https://github.com/nix-community/home-manager) - [agenix](https://github.com/ryantm/agenix) - [cachix](https://cachix.org) -- [deploy-rs](https://github.com/serokell/deploy-rs) +- [nixinate](https://github.com/MatthewCroughan/nixinate) - [flake-parts](https://github.com/hercules-ci/flake-parts) - [terranix](https://github.com/terranix/terranix) - [lanzaboote](https://github.com/nix-community/lanzaboote) @@ -113,34 +113,6 @@ "type": "github" } }, - "deploy": { - "inputs": { - "flake-compat": [ - "pre-commit", - "flake-compat" - ], - "nixpkgs": [ - "nixpkgs" - ], - "utils": [ - "pre-commit", - "flake-utils" - ] - }, - "locked": { - "lastModified": 1703087360, - "narHash": "sha256-0VUbWBW8VyiDRuimMuLsEO4elGuUw/nc2WDeuO1eN1M=", - "owner": "serokell", - "repo": "deploy-rs", - "rev": "b709d63debafce9f5645a5ba550c9e0983b3d1f7", - "type": "github" - }, - "original": { - "owner": "serokell", - "repo": "deploy-rs", - "type": "github" - } - }, "fenix": { "inputs": { "nixpkgs": [ @@ -382,6 +354,26 @@ "type": "github" } }, + "nixinate": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1688141737, + "narHash": "sha256-qHrNMYWukOKmKVf6wXOGKj1xxUnOGjvTRbt/PLLXuBE=", + "owner": "MatthewCroughan", + "repo": "nixinate", + "rev": "7902ae845e6cc5bd450e510cdf5e009a6e4a44d9", + "type": "github" + }, + "original": { + "owner": "MatthewCroughan", + "repo": "nixinate", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1702453208, @@ -569,12 +561,12 @@ "arkenfox": "arkenfox", "catppuccin": "catppuccin", "darwin": "darwin", - "deploy": "deploy", "firefox-addons": "firefox-addons", "getchvim": "getchvim", "hm": "hm", "lanzaboote": "lanzaboote", "nix-index-database": "nix-index-database", + "nixinate": "nixinate", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs", @@ -40,15 +40,6 @@ catppuccin.url = "github:Stonks3141/ctp-nix"; - deploy = { - url = "github:serokell/deploy-rs"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-compat.follows = "pre-commit/flake-compat"; - utils.follows = "pre-commit/flake-utils"; - }; - }; - firefox-addons = { url = "sourcehut:~rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs = { @@ -81,6 +72,11 @@ }; }; + nixinate = { + url = "github:MatthewCroughan/nixinate"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-index-database = { url = "github:nix-community/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; @@ -14,43 +14,42 @@ asRoot := if os() == "linux" { "true" } else { "false" } default: @just --choose -[linux] -[macos] [private] rebuild subcmd root="false": {{ if root == "true" { "sudo " } else { "" } }}{{ rebuild }} {{ subcmd }} {{ rebuildArgs }} --flake . -[linux] -[macos] boot: @just rebuild boot {{ asRoot }} -[linux] -[macos] build: @just rebuild build -check: - nix flake check - -[linux] -[macos] dry-run: @just rebuild dry-run -pre-commit: - pre-commit run - -[linux] -[macos] switch: @just rebuild switch {{ asRoot }} -[linux] -[macos] test: @just rebuild test {{ asRoot }} +ci: + nix run \ + --inputs-from . \ + --override-input nixpkgs nixpkgs \ + github:Mic92/nix-fast-build -- \ + --no-nom \ + --skip-cached \ + --option accept-flake-config true \ + --flake '.#hydraJobs' + +check: + nix flake check \ + --print-build-logs \ + --show-trace \ + --accept-flake-config \ + --allow-import-from-derivation + update: nix flake update @@ -60,6 +59,14 @@ update-input input: --commit-lock-file \ --commit-lockfile-summary "flake: update {{ input }}" +deploy-all: + for system in "atlas"; do \ + nix run ".#$system"; \ + done + +pre-commit: + pre-commit run + clean: rm -rf \ result* \ diff --git a/systems/atlas/default.nix b/systems/atlas/default.nix index 836aef7..9e8f926 100644 --- a/systems/atlas/default.nix +++ b/systems/atlas/default.nix @@ -10,6 +10,14 @@ ./teawiebot.nix ]; + _module.args.nixinate = { + host = config.networking.hostName; + sshUser = "root"; + buildOn = "remote"; + substituteOnTarget = true; + hermetic = false; + }; + boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; diff --git a/systems/default.nix b/systems/default.nix index 47f6bf6..bdfaee0 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -28,8 +28,6 @@ mapNixOS = mapSystems inputs.nixpkgs.lib.nixosSystem; inherit (import ./common.nix {inherit inputs self;}) darwin nixos server; in { - imports = [./deploy.nix]; - flake = { darwinConfigurations = mapDarwin { caroline = { @@ -78,4 +76,8 @@ in { inherit (inputs) openwrt-imagebuilder; }); }; + + perSystem = {system, ...}: { + apps = (inputs.nixinate.nixinate.${system} self).nixinate; + }; } diff --git a/systems/deploy.nix b/systems/deploy.nix deleted file mode 100644 index fbf20d3..0000000 --- a/systems/deploy.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - lib, - inputs, - self, - ... -}: let - targets = ["atlas"]; - configurations = self.nixosConfigurations // self.darwinConfigurations; - - getDeploy = pkgs: - (pkgs.appendOverlays [ - inputs.deploy.overlay - (_: prev: { - deploy-rs = { - inherit (pkgs) deploy-rs; - inherit (prev.deploy-rs) lib; - }; - }) - ]) - .deploy-rs; - - toType = system: - { - "Linux" = "nixos"; - "Darwin" = "darwin"; - } - .${system}; - - toDeployNode = hostname: system: { - sshUser = "root"; - inherit hostname; - profiles.system.path = let - deploy = getDeploy system.pkgs; - type = toType system.pkgs.stdenv.hostPlatform.uname.system; - in - deploy.lib.activate.${type} system; - }; -in { - flake.deploy = { - remoteBuild = true; - fastConnection = false; - nodes = lib.mapAttrs toDeployNode (lib.getAttrs targets configurations); - }; -} |
