chore: replace deploy-rs with nixinate
This commit is contained in:
parent
d6b34b37e4
commit
fca8b6d29c
7 changed files with 63 additions and 102 deletions
|
@ -1,4 +1,12 @@
|
|||
{
|
||||
{config, ...}: {
|
||||
_module.args.nixinate = {
|
||||
host = config.networking.hostName;
|
||||
sshUser = "root";
|
||||
buildOn = "remote";
|
||||
substituteOnTarget = true;
|
||||
hermetic = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
tailscale.extraUpFlags = ["--advertise-exit-node"];
|
||||
|
||||
|
|
46
flake.lock
46
flake.lock
|
@ -86,30 +86,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"deploy-rs": {
|
||||
"inputs": {
|
||||
"flake-compat": [],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"utils": [
|
||||
"flake-utils"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1718194053,
|
||||
"narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=",
|
||||
"owner": "serokell",
|
||||
"repo": "deploy-rs",
|
||||
"rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "serokell",
|
||||
"repo": "deploy-rs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -340,6 +316,26 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixinate": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1708891350,
|
||||
"narHash": "sha256-VOQrKK7Df/IVuNki+NshVuGkTa/Tw0GigPjWcZff6kk=",
|
||||
"owner": "matthewcroughan",
|
||||
"repo": "nixinate",
|
||||
"rev": "452f33c60df5b72ad0858f5f2cf224bdf1f17746",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "matthewcroughan",
|
||||
"repo": "nixinate",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": [],
|
||||
|
@ -417,12 +413,12 @@
|
|||
"api-rs": "api-rs",
|
||||
"catppuccin": "catppuccin",
|
||||
"crane": "crane",
|
||||
"deploy-rs": "deploy-rs",
|
||||
"flake-parts": "flake-parts",
|
||||
"flake-utils": "flake-utils",
|
||||
"ghostty": "ghostty",
|
||||
"home-manager": "home-manager",
|
||||
"lanzaboote": "lanzaboote",
|
||||
"nixinate": "nixinate",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems_3",
|
||||
|
|
38
flake.nix
38
flake.nix
|
@ -1,15 +1,37 @@
|
|||
{
|
||||
description = "example flake idk";
|
||||
|
||||
outputs = {flake-parts, ...} @ inputs:
|
||||
outputs = {
|
||||
self,
|
||||
flake-parts,
|
||||
nixinate,
|
||||
...
|
||||
} @ inputs:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux"];
|
||||
|
||||
imports = [
|
||||
./parts
|
||||
./systems
|
||||
./exprs
|
||||
];
|
||||
|
||||
perSystem = {
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
apps = (nixinate.nixinate.${system} self).nixinate;
|
||||
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
just
|
||||
statix
|
||||
nix-output-monitor
|
||||
];
|
||||
};
|
||||
|
||||
formatter = pkgs.alejandra;
|
||||
};
|
||||
};
|
||||
|
||||
inputs = {
|
||||
|
@ -30,13 +52,6 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
deploy-rs = {
|
||||
url = "github:serokell/deploy-rs";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.utils.follows = "flake-utils";
|
||||
inputs.flake-compat.follows = "";
|
||||
};
|
||||
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
|
@ -64,6 +79,11 @@
|
|||
inputs.flake-compat.follows = "";
|
||||
};
|
||||
|
||||
nixinate = {
|
||||
url = "github:matthewcroughan/nixinate";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixos-wsl = {
|
||||
url = "github:nix-community/NixOS-WSL";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
|
14
justfile
14
justfile
|
@ -1,21 +1,15 @@
|
|||
# Shamelessly taken from https://github.com/getchoo/flake/blob/d80d49cc7652ea84810c4688212c48277dfc71be/justfile
|
||||
|
||||
alias c := check
|
||||
alias s := switch
|
||||
alias d := deploy
|
||||
|
||||
default:
|
||||
@just --choose
|
||||
|
||||
check:
|
||||
nix flake check
|
||||
|
||||
[linux]
|
||||
switch *args:
|
||||
sudo nixos-rebuild switch --flake . --keep-going {{ args }}
|
||||
@sudo -v
|
||||
sudo nixos-rebuild switch --flake . --keep-going {{args}} --log-format internal-json |& nom --json
|
||||
|
||||
deploy system:
|
||||
deploy -s .#{{ system }}
|
||||
nix run .#{{system}}
|
||||
|
||||
lint *args:
|
||||
statix check -i flake.nix **/hardware-configuration.nix {{ args }}
|
||||
statix check -i flake.nix **/hardware-configuration.nix {{args}}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
./deploy.nix
|
||||
./dev.nix
|
||||
];
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
systems = ["etna"];
|
||||
|
||||
getDeploy = pkgs:
|
||||
(pkgs.appendOverlays [
|
||||
inputs.deploy-rs.overlay
|
||||
(_: prev: {
|
||||
deploy-rs = {
|
||||
inherit (pkgs) deploy-rs;
|
||||
inherit (prev.deploy-rs) lib;
|
||||
};
|
||||
})
|
||||
])
|
||||
.deploy-rs;
|
||||
|
||||
toDeployNode = hostname: system: {
|
||||
inherit hostname;
|
||||
sshUser = "root";
|
||||
|
||||
profiles.system.path = let deploy = getDeploy system.pkgs; in deploy.lib.activate.nixos system;
|
||||
};
|
||||
in {
|
||||
flake = {
|
||||
deploy = {
|
||||
remoteBuild = true;
|
||||
fastConnection = false;
|
||||
nodes = lib.mapAttrs toDeployNode (lib.getAttrs systems self.nixosConfigurations);
|
||||
};
|
||||
|
||||
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
||||
};
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
perSystem = {pkgs, ...}: {
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
just
|
||||
nil
|
||||
statix
|
||||
deploy-rs
|
||||
];
|
||||
};
|
||||
|
||||
formatter = pkgs.alejandra;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue