From 2b8383117998d595afb09838140c4a61dce87eb3 Mon Sep 17 00:00:00 2001 From: baduhai Date: Tue, 29 Nov 2022 19:46:04 -0300 Subject: [PATCH] Possible fix for source not found issue --- flake.lock | 6 ++--- flake.nix | 4 ++-- hosts/desktops/common/nix.nix | 12 ++++++++++ hosts/desktops/io.nix | 42 ++++++++++++++++++----------------- 4 files changed, 39 insertions(+), 25 deletions(-) create mode 100644 hosts/desktops/common/nix.nix diff --git a/flake.lock b/flake.lock index 6d83ebb..cf69244 100644 --- a/flake.lock +++ b/flake.lock @@ -99,11 +99,11 @@ }, "nur": { "locked": { - "lastModified": 1669749637, - "narHash": "sha256-QAJt9dov1gJTNFaWbEwaHV1IDtVrsM18E7LsLsvsHIA=", + "lastModified": 1669758617, + "narHash": "sha256-aOucvlsBl2c6YXXw+byes7kLUILBbFp2/e3VSJYDs2U=", "owner": "nix-community", "repo": "nur", - "rev": "f7b4e636b872255bf3ea0712d93ce9dc934d4076", + "rev": "0517f9ff4814db2a25b994b089157e38b036af96", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ec6ebf0..433d070 100644 --- a/flake.nix +++ b/flake.nix @@ -24,15 +24,15 @@ }; }; - outputs = { nixpkgs, home-manager, nur, kmonad, nixpkgs-stable, home-manager-stable, ... }: { + outputs = inputs @ { nixpkgs, home-manager, nur, kmonad, nixpkgs-stable, home-manager-stable, ... }: { nixosConfigurations = { io = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { inherit inputs; }; modules = [ ./hosts/desktops/io.nix kmonad.nixosModules.default { nixpkgs.overlays = [ nur.overlay ]; } -# ( {...}: { nix.registry.nixpkgs.flake = nixpkgs; } ) home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/hosts/desktops/common/nix.nix b/hosts/desktops/common/nix.nix new file mode 100644 index 0000000..51ae6ee --- /dev/null +++ b/hosts/desktops/common/nix.nix @@ -0,0 +1,12 @@ +{ inputs, config, pkgs, lib, ... }: + +{ + nix = { + registry.nixpkgs.flake = inputs.nixpkgs; + nixPath = [ + "nixpkgs=/etc/channels/nixpkgs" + "nixos-config=/etc/nixos/configuration.nix" + "/nix/var/nix/profiles/per-user/root/channels" + ]; + }; +} diff --git a/hosts/desktops/io.nix b/hosts/desktops/io.nix index 2e04450..bc846aa 100644 --- a/hosts/desktops/io.nix +++ b/hosts/desktops/io.nix @@ -5,30 +5,30 @@ # Host-specific imports ./io/hardware-configuration.nix # Host-common imports - ../../common/networking.nix - ../../common/services.nix - ../../common/packages.nix - ../../common/locale.nix - ../../common/users.nix - ../../common/boot.nix - ../../common/nix.nix - # Desktop-common imports - ../common/virtualisation.nix - ../common/hardware.nix + ../common/networking.nix ../common/services.nix ../common/packages.nix + ../common/locale.nix ../common/users.nix ../common/boot.nix + ../common/nix.nix + # Desktop-common imports + ./common/virtualisation.nix + ./common/hardware.nix + ./common/services.nix + ./common/packages.nix + ./common/users.nix + ./common/boot.nix ]; networking.hostName = "io"; - environment.systemPackages = with pkgs; [ - gnome-network-displays - maliit-keyboard - rnote - write_stylus - ]; + nix.nixPath = [ "nixos-config=/home/user/Projects/nix-config/hosts/desktops/io.nix" ]; + + zramSwap = { + enable = true; + memoryPercent = 100; + }; boot.kernelParams = [ "nosgx" @@ -36,10 +36,12 @@ "mem_sleep_default=deep" ]; - zramSwap = { - enable = true; - memoryPercent = 100; - }; + environment.systemPackages = with pkgs; [ + gnome-network-displays + maliit-keyboard + rnote + write_stylus + ]; services = { kmonad = {