From 6337166829c5a2170b076a10f237cca0a94bb3ce Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sat, 30 Jul 2022 05:03:10 +0300 Subject: [PATCH] nixinated --- flake.lock | 57 +++++++++++++-------- flake.nix | 20 +++++--- hosts/wolumonde/default.nix | 12 ++++- hosts/wolumonde/hardware-configuration.nix | 16 +++--- secrets/wolumonde-ip | Bin 0 -> 35 bytes 5 files changed, 68 insertions(+), 37 deletions(-) create mode 100644 secrets/wolumonde-ip diff --git a/flake.lock b/flake.lock index 7828d1f..1ec1755 100644 --- a/flake.lock +++ b/flake.lock @@ -218,6 +218,24 @@ "type": "github" } }, + "nixinate": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1654872030, + "narHash": "sha256-a1e49vvdEapkG9tbC0WLEemLGXbMR6hEBeW22aGwueQ=", + "owner": "matthewcroughan", + "repo": "nixinate", + "rev": "0f53b4f183fbde2ba2b50d3e7dd910b86ea179ed", + "type": "github" + }, + "original": { + "owner": "matthewcroughan", + "repo": "nixinate", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1656933710, @@ -249,6 +267,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1653060744, + "narHash": "sha256-kfRusllRumpt33J1hPV+CeCCylCXEU7e0gn2/cIM7cY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "dfd82985c273aac6eced03625f454b334daae2e8", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1657447684, "narHash": "sha256-FCP9AuU1q6PE3vOeM5SFf58f/UKPBAsoSGDUGamNBbo=", @@ -285,11 +319,11 @@ "helix": "helix", "home": "home", "hyprland": "hyprland", + "nixinate": "nixinate", "nixos-hardware": "nixos-hardware", "nixos-persistence": "nixos-persistence", - "nixpkgs": "nixpkgs", - "nur": "nur", - "smos": "smos" + "nixpkgs": "nixpkgs_2", + "nur": "nur" } }, "rust-overlay": { @@ -314,23 +348,6 @@ "type": "github" } }, - "smos": { - "flake": false, - "locked": { - "lastModified": 1654691963, - "narHash": "sha256-XY2esyEIZJr37aflbkn37a3wWBTAtl93a7pAHKfDH5E=", - "owner": "yusdacra", - "repo": "smos", - "rev": "c11222bc1c836746dbaf1fdffea92509ce775faf", - "type": "github" - }, - "original": { - "owner": "yusdacra", - "ref": "chore/fix-nix-flakes", - "repo": "smos", - "type": "github" - } - }, "utils": { "locked": { "lastModified": 1653893745, diff --git a/flake.nix b/flake.nix index 589406b..76583f6 100644 --- a/flake.nix +++ b/flake.nix @@ -11,8 +11,7 @@ nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-persistence.url = "github:nix-community/impermanence"; - smos.url = "github:yusdacra/smos/chore/fix-nix-flakes"; - smos.flake = false; + nixinate.url = "github:matthewcroughan/nixinate"; helix.url = "github:helix-editor/helix"; helix.inputs.nixpkgs.follows = "nixpkgs"; @@ -32,22 +31,27 @@ }; genPkgs = f: prev.genSystems (system: f (makePkgs system)); }); - allPkgs = tlib.genPkgs (x: x); - in rec { - nixosConfigurations = import ./hosts {inherit lib tlib inputs;}; - packages = lib.mapAttrs (_: pkgs: pkgs._exported) allPkgs; - apps = + allPkgs = tlib.genPkgs (x: x); + + miscApps = lib.mapAttrs ( _: pkgs: { generate-firefox-addons = { type = "app"; - program = toString "${pkgs.generate-firefox-addons}/bin/generate-firefox-addons"; + program = + toString + "${pkgs.generate-firefox-addons}/bin/generate-firefox-addons"; }; } ) allPkgs; + in rec { + nixosConfigurations = import ./hosts {inherit lib tlib inputs;}; + + packages = lib.mapAttrs (_: pkgs: pkgs._exported) allPkgs; + apps = miscApps // (inputs.nixinate.nixinate.x86_64-linux inputs.self); devShells = import ./shells {inherit lib tlib inputs;}; }; diff --git a/hosts/wolumonde/default.nix b/hosts/wolumonde/default.nix index e2de7c7..2f4b9da 100644 --- a/hosts/wolumonde/default.nix +++ b/hosts/wolumonde/default.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: { +{inputs, ...}: { imports = [ ./hardware-configuration.nix ]; @@ -14,4 +14,12 @@ users.users.root.openssh.authorizedKeys.keys = [ (builtins.readFile "${inputs.self}/secrets/ssh-key.pub") ]; -} \ No newline at end of file + + _module.args.nixinate = { + host = builtins.readFile "${inputs.self}/secrets/wolumonde-ip"; + sshUser = "root"; + buildOn = "local"; # valid args are "local" or "remote" + substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" + hermetic = true; + }; +} diff --git a/hosts/wolumonde/hardware-configuration.nix b/hosts/wolumonde/hardware-configuration.nix index 3542c25..1593075 100644 --- a/hosts/wolumonde/hardware-configuration.nix +++ b/hosts/wolumonde/hardware-configuration.nix @@ -1,8 +1,10 @@ -{ modulesPath, ... }: -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; +{modulesPath, ...}: { + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; boot.loader.grub.device = "/dev/sda"; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ]; - boot.initrd.kernelModules = [ "nvme" ]; - fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; -} \ No newline at end of file + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"]; + boot.initrd.kernelModules = ["nvme"]; + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; +} diff --git a/secrets/wolumonde-ip b/secrets/wolumonde-ip new file mode 100644 index 0000000000000000000000000000000000000000..7aa5b305c4dbbb9b050c523c78fb57122b297ce5 GIT binary patch literal 35 tcmV+;0NnooM@dveQdv+`0NS9OqQVB@2lOnL4nxN#3rhFM->1aHLG|}15G()y literal 0 HcmV?d00001