diff --git a/flake.lock b/flake.lock index 4a2aa01..c5f2642 100644 --- a/flake.lock +++ b/flake.lock @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1712798444, - "narHash": "sha256-aAksVB7zMfBQTz0q2Lw3o78HM3Bg2FRziX2D6qnh+sk=", + "lastModified": 1712612224, + "narHash": "sha256-Tv4C8OSPVmm4LbpJGLFSODyvJy6DqrisEGPCQdNVOeY=", "owner": "nix-community", "repo": "disko", - "rev": "a297cb1cb0337ee10a7a0f9517954501d8f6f74d", + "rev": "79eab0e82cb126bf4ac170f44af82479f0895ab5", "type": "github" }, "original": { @@ -587,7 +587,7 @@ "hercules-ci-effects_3": { "inputs": { "flake-parts": "flake-parts_7", - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1701009247, @@ -624,27 +624,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "nix-on-droid", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709445365, - "narHash": "sha256-DVv6nd9FQBbMWbOmhq0KVqmlc3y3FMSYl49UXmMcO+0=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "4de84265d7ec7634a69ba75028696d74de9a44a7", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "homeManager": { "inputs": { "nixpkgs": [ @@ -652,11 +631,11 @@ ] }, "locked": { - "lastModified": 1712759992, - "narHash": "sha256-2APpO3ZW4idlgtlb8hB04u/rmIcKA8O7pYqxF66xbNY=", + "lastModified": 1712730572, + "narHash": "sha256-rAVvdP77rEmgobvSgybqPAcHefv5dCXPH/ge6Ds+JtU=", "owner": "nix-community", "repo": "home-manager", - "rev": "31357486b0ef6f4e161e002b6893eeb4fafc3ca9", + "rev": "18f89ef74f0d48635488ccd6a5e30dc9d48a3a87", "type": "github" }, "original": { @@ -746,52 +725,6 @@ "type": "github" } }, - "nix-formatter-pack": { - "inputs": { - "nixpkgs": [ - "nix-on-droid", - "nixpkgs" - ], - "nmd": "nmd", - "nmt": "nmt" - }, - "locked": { - "lastModified": 1705252799, - "narHash": "sha256-HgSTREh7VoXjGgNDwKQUYcYo13rPkltW7IitHrTPA5c=", - "owner": "Gerschtli", - "repo": "nix-formatter-pack", - "rev": "2de39dedd79aab14c01b9e2934842051a160ffa5", - "type": "github" - }, - "original": { - "owner": "Gerschtli", - "repo": "nix-formatter-pack", - "type": "github" - } - }, - "nix-on-droid": { - "inputs": { - "home-manager": "home-manager_2", - "nix-formatter-pack": "nix-formatter-pack", - "nixpkgs": "nixpkgs_7", - "nixpkgs-docs": "nixpkgs-docs", - "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", - "nmd": "nmd_2" - }, - "locked": { - "lastModified": 1710434231, - "narHash": "sha256-yrWnsG28518tbIapJWiluweHORuuIwAQrA8lga0Sqlw=", - "owner": "nix-community", - "repo": "nix-on-droid", - "rev": "2d93311c4f3f300154d2085e4b4b1d550237da92", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-on-droid", - "type": "github" - } - }, "nixDarwin": { "inputs": { "nixpkgs": [ @@ -838,11 +771,11 @@ }, "nixosHardware": { "locked": { - "lastModified": 1712760404, - "narHash": "sha256-4zhaEW1nB+nGbCNMjOggWeY5nXs/H0Y71q0+h+jdxoU=", + "lastModified": 1712739139, + "narHash": "sha256-I8fw3ot29H9TXClIJHmPfQXaq2dEXHs2VmZeMEw7sb4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "e1c4bac14beb8c409d0534382cf967171706b9d9", + "rev": "805adee81c82efbe50cac7398c4de05769488ed9", "type": "github" }, "original": { @@ -867,38 +800,6 @@ "type": "github" } }, - "nixpkgs-docs": { - "locked": { - "lastModified": 1705957679, - "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-for-bootstrap": { - "locked": { - "lastModified": 1708105575, - "narHash": "sha256-sS4AItZeUnAei6v8FqxNlm+/27MPlfoGym/TZP0rmH0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26", - "type": "github" - } - }, "nixpkgs-kernel": { "locked": { "lastModified": 1656239181, @@ -1150,21 +1051,6 @@ } }, "nixpkgs_7": { - "locked": { - "lastModified": 1708172716, - "narHash": "sha256-3M94oln0b61m3dUmLyECCA9hYAHXZEszM4saE3CmQO4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5d874ac46894c896119bce68e758e9e80bdb28f1", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_8": { "locked": { "lastModified": 1697723726, "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", @@ -1180,7 +1066,7 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_8": { "locked": { "lastModified": 1678470307, "narHash": "sha256-OEeMUr3ueLIXyW/OaFUX5jUdimyQwMg/7e+/Q0gC/QE=", @@ -1196,67 +1082,13 @@ "type": "github" } }, - "nmd": { - "flake": false, - "locked": { - "lastModified": 1666190571, - "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", - "owner": "rycee", - "repo": "nmd", - "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", - "type": "gitlab" - }, - "original": { - "owner": "rycee", - "repo": "nmd", - "type": "gitlab" - } - }, - "nmd_2": { - "inputs": { - "nixpkgs": [ - "nix-on-droid", - "nixpkgs-docs" - ], - "scss-reset": "scss-reset" - }, - "locked": { - "lastModified": 1705050560, - "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", - "owner": "~rycee", - "repo": "nmd", - "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", - "type": "sourcehut" - }, - "original": { - "owner": "~rycee", - "repo": "nmd", - "type": "sourcehut" - } - }, - "nmt": { - "flake": false, - "locked": { - "lastModified": 1648075362, - "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", - "owner": "rycee", - "repo": "nmt", - "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", - "type": "gitlab" - }, - "original": { - "owner": "rycee", - "repo": "nmt", - "type": "gitlab" - } - }, "nur": { "locked": { - "lastModified": 1712840159, - "narHash": "sha256-IWyQcCfyBW3V1yI1J8DVWwqrbh2mw928Vv3OwW6TEt8=", + "lastModified": 1712753744, + "narHash": "sha256-gmw5cWa/+K78CDkx1o5RlwPPgYTRaIhoF5bI4LI6HuQ=", "owner": "nix-community", "repo": "NUR", - "rev": "c853b2bdc1d750a4ba2eef266976127eca4dbcdc", + "rev": "72a299e9362607acd61c99c1858d0b4d1e6d2aef", "type": "github" }, "original": { @@ -1367,7 +1199,7 @@ "fan-control": "fan-control", "flake-parts": "flake-parts_8", "kernel-src": "kernel-src", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_8", "nixpkgs-kernel": "nixpkgs-kernel", "panfork": "panfork", "tow-boot": "tow-boot", @@ -1400,7 +1232,6 @@ "homeManagerGitWorkspace": "homeManagerGitWorkspace", "homeManagerSwayNC": "homeManagerSwayNC", "nix-fast-build": "nix-fast-build", - "nix-on-droid": "nix-on-droid", "nixDarwin": "nixDarwin", "nixThePlanet": "nixThePlanet", "nixosHardware": "nixosHardware", @@ -1413,22 +1244,6 @@ "treefmt-nix": "treefmt-nix_3" } }, - "scss-reset": { - "flake": false, - "locked": { - "lastModified": 1631450058, - "narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=", - "owner": "andreymatin", - "repo": "scss-reset", - "rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91", - "type": "github" - }, - "original": { - "owner": "andreymatin", - "repo": "scss-reset", - "type": "github" - } - }, "slimlock": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 70ca18e..377e1ff 100644 --- a/flake.nix +++ b/flake.nix @@ -55,7 +55,6 @@ url = "github:LnL7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgsUnstable"; }; - nix-on-droid.url = "github:nix-community/nix-on-droid"; }; outputs = inputs @ {flakeParts, ...}: diff --git a/hosts/default.nix b/hosts/default.nix index 9448dc0..3459702 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -8,9 +8,8 @@ imports = [./module.nix]; fleet = { - darwinHosts.archer = {}; - - nixOnDroidHosts.janeway = {}; + darwinHosts.archer = { + }; hosts = { # thinkpad = { @@ -165,4 +164,14 @@ }; }; }; + + flake.nixosConfigurations = + lib.mapAttrs + config.fleet._mkNixosConfiguration + config.fleet.hosts; + + flake.darwinConfigurations = + lib.mapAttrs + config.fleet._mkDarwinConfiguration + config.fleet.darwinHosts; } diff --git a/hosts/janeway/default.nix b/hosts/janeway/default.nix deleted file mode 100644 index 54c0975..0000000 --- a/hosts/janeway/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - sshdTmpDirectory = "${config.user.home}/sshd-tmp"; - sshdDirectory = "${config.user.home}/sshd"; - pathToPubKey = "/mnt/sdcard/Download/picard_host_key.pub"; - port = 8022; -in { - # Backup etc files instead of failing to activate generation if a file already exists in /etc - environment.etcBackupExtension = ".bak"; - - # Read the changelog before changing this value - system.stateVersion = "23.11"; - - # Set up nix for flakes - nix.extraOptions = '' - experimental-features = nix-command flakes - ''; - - # Set your time zone - time.timeZone = "Europe/Rome"; - - build.activation.sshd = '' - $DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh" - $DRY_RUN_CMD cat ${pathToPubKey} > "${config.user.home}/.ssh/authorized_keys" - - if [[ ! -d "${sshdDirectory}" ]]; then - $DRY_RUN_CMD rm $VERBOSE_ARG --recursive --force "${sshdTmpDirectory}" - $DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${sshdTmpDirectory}" - - $VERBOSE_ECHO "Generating host keys..." - $DRY_RUN_CMD ${pkgs.openssh}/bin/ssh-keygen -t rsa -b 4096 -f "${sshdTmpDirectory}/ssh_host_rsa_key" -N "" - - $VERBOSE_ECHO "Writing sshd_config..." - $DRY_RUN_CMD echo -e "HostKey ${sshdDirectory}/ssh_host_rsa_key\nPort ${toString port}\n" > "${sshdTmpDirectory}/sshd_config" - - $DRY_RUN_CMD mv $VERBOSE_ARG "${sshdTmpDirectory}" "${sshdDirectory}" - fi - ''; - - environment.packages = [ - pkgs.vim - pkgs.bottom - pkgs.helix - pkgs.stress - pkgs.openssh - pkgs.git - (pkgs.writeScriptBin "sshd-start" '' - #!${pkgs.runtimeShell} - - echo "Starting sshd in non-daemonized way on port ${toString port}" - ${pkgs.openssh}/bin/sshd -f "${sshdDirectory}/sshd_config" -D - '') - ]; -} diff --git a/hosts/module.nix b/hosts/module.nix index 507d279..a1da41a 100644 --- a/hosts/module.nix +++ b/hosts/module.nix @@ -48,42 +48,6 @@ in { }; })); }; - nixOnDroidHosts = lib.mkOption { - type = lib.types.attrsOf (lib.types.submodule ({name, ...}: { - options = { - name = lib.mkOption { - description = "Host name"; - type = lib.types.strMatching "^$|^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$"; - default = name; - }; - system = lib.mkOption { - description = "NixOS architecture (a.k.a. system)"; - type = lib.types.str; - default = "aarch64-linux"; - }; - nixpkgs = lib.mkOption { - description = "Used nixpkgs"; - type = lib.types.anything; - default = inputs.nixpkgsUnstable; - }; - extraModules = lib.mkOption { - description = "Extra NixOS modules"; - type = lib.types.listOf lib.types.deferredModule; - default = []; - }; - overlays = lib.mkOption { - description = "Enabled Nixpkgs overlays"; - type = lib.types.listOf (lib.mkOptionType { - name = "nixpkgs-overlay"; - description = "nixpkgs overlay"; - check = lib.isFunction; - merge = lib.mergeOneOption; - }); - default = []; - }; - }; - })); - }; hosts = lib.mkOption { description = "Host configuration"; type = lib.types.attrsOf (lib.types.submodule ({name, ...}: { @@ -279,41 +243,5 @@ in { ]; }; }; - - _mkNixOnDroidConfiguration = lib.mkOption { - description = "Function returning a proper nix-on-droid configuration"; - type = lib.types.functionTo (lib.types.functionTo lib.types.attrs); # TODO improve this type - internal = true; - default = hostname: config: - inputs.nix-on-droid.lib.nixOnDroidConfiguration { - modules = [ - ({ - lib, - pkgs, - ... - }: { - nixpkgs.overlays = config.overlays; - }) - "${self.outPath}/hosts/${hostname}" - ]; - }; - }; - }; - - config = { - flake.nixosConfigurations = - lib.mapAttrs - config.fleet._mkNixosConfiguration - config.fleet.hosts; - - flake.darwinConfigurations = - lib.mapAttrs - config.fleet._mkDarwinConfiguration - config.fleet.darwinHosts; - - flake.nixOnDroidConfigurations = - lib.mapAttrs - config.fleet._mkNixOnDroidConfiguration - config.fleet.nixOnDroidHosts; }; }