diff options
author | stuebinm | 2022-01-09 08:09:39 +0100 |
---|---|---|
committer | stuebinm | 2022-01-09 08:12:16 +0100 |
commit | e88fed18f499a3e8ac98c772bbb62f00d1f8d1d7 (patch) | |
tree | 2acb627ac0bf070d42f3b214015fdf1b4e920c44 /modules | |
parent | eb97c76228dd9675ccfe4662ca551f07327ca9b4 (diff) |
use flakes instead of niv & stuff
Diffstat (limited to 'modules')
-rw-r--r-- | modules/default.nix | 9 | ||||
-rw-r--r-- | modules/deploy/default.nix | 50 |
2 files changed, 0 insertions, 59 deletions
diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index e512563..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: -let - sources = import ../nix/sources.nix {}; -in -{ - #imports = [ "${sources.nixpkgs-unstable}/nixos/modules/services/networking/pleroma.nix" ]; - - # to stop the manual breaking from the stable / unstable mix -} diff --git a/modules/deploy/default.nix b/modules/deploy/default.nix deleted file mode 100644 index e8bc827..0000000 --- a/modules/deploy/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ config, pkgs, lib, ... }: - -with lib; - -let - cfg = config.hexchen.deploy; - -in { - options = { - hexchen.deploy = { - enable = mkOption { - type = types.bool; - default = true; - }; - ssh.host = mkOption { - type = types.str; - default = "${config.networking.hostName}.${config.networking.domain}"; - }; - ssh.port = mkOption { - type = types.int; - default = head config.services.openssh.ports; - }; - substitute = mkOption { - type = types.bool; - default = true; - }; - groups = mkOption { - type = with types; listOf str; - default = []; - }; - }; - }; - - config = mkIf cfg.enable { - hexchen.deploy.groups = [ "all" ]; - - system.build.deployScript = let - superuser = if config.security.sudo.enable then "sudo" else ""; - in pkgs.writeScript "deploy-${config.networking.hostName}" '' - #!${pkgs.runtimeShell} - set -xeo pipefail - export PATH=${with pkgs; lib.makeBinPath [ coreutils openssh nix ]} - export NIX_SSHOPTS="$NIX_SSHOPTS -p${toString cfg.ssh.port}" - nix copy ${if cfg.substitute then "-s" else ""} --no-check-sigs --to ssh://${cfg.ssh.host} ${config.system.build.toplevel} - ssh $NIX_SSHOPTS ${cfg.ssh.host} "${superuser} nix-env -p /nix/var/nix/profiles/system -i ${config.system.build.toplevel}" - ssh $NIX_SSHOPTS ${cfg.ssh.host} "${superuser} /nix/var/nix/profiles/system/bin/switch-to-configuration $1" - ''; - }; -} - |