commit 029ef988752f037ac32076d0317c9a5da54083a5
parent 45f6d30c7ab506bc24bc14b2044f8eefb15a7011
Author: Vincent Demeester <vincent@sbr.pm>
Date: Thu, 21 May 2020 12:25:47 +0200
Slowly trying to use nix/ for truth
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
7 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/README.org b/README.org
@@ -101,8 +101,13 @@
:END:
Repositories
+- https://github.com/utdemir/dotfiles
+- https://github.com/davidtwco/veritas
+- https://gitlab.com/samueldr/nixos-configuration
+- https://github.com/rasendubi/dotfiles
- [[https://github.com/akirak/nixos-config]]
- [[https://github.com/akirak/home.nix]]
+- https://github.com/cstrahan/nixos-config
- [[https://github.com/jwiegley/nix-config]]
- [[https://github.com/arianvp/nixos-stuff]]
- [[https://github.com/leotaku/nixos-config]]
@@ -132,6 +137,11 @@
- [[https://github.com/uwap/nixos-configs]]
- [[https://github.com/yacinehmito/yarn-nix]]
- [[https://github.com/yrashk/nix-home]]
+- https://github.com/pSub/configs
+- https://github.com/periklis/nix-config
+- https://github.com/peel/dotfiles
+- https://github.com/bennofs/etc-nixos
+- https://github.com/Baughn/machine-config
* COPYING
:PROPERTIES:
diff --git a/configuration.nix b/configuration.nix
@@ -1,13 +1,20 @@
# This configuration file simply determines the hostname and then import both
# the default configuration (common for all machine) and specific machine
# configuration.
+{ sources ? import ../nix/sources.nix
+, pkgs ? import sources.nixos-unstable
+, ...
+}:
let
hostName = "${builtins.readFile ./hostname}";
+ sources = import ./nix/sources.nix;
in
{
- imports = [
+ imports = with sources; [
# Generated hardware configuration
./hardware-configuration.nix
+ # Load home-manager nixos module
+ "${home-manager}/nixos"
# Default profile with default configuration
./modules/module-list.nixos.nix
# Set the machine to nixos
diff --git a/home.nix b/home.nix
@@ -1,11 +1,22 @@
# This configuration file simply determines the hostname and then import both
# the default configuration (common for all machine) and specific machine
# configuration.
+{ sources ? import ../nix/sources.nix
+, pkgs ? import sources.nixpkgs { }
+, ...
+}:
let
hostName = "${builtins.readFile ./hostname}";
+ sources = import ./nix/sources.nix;
in
{
- imports = [
+ programs = {
+ home-manager = {
+ enable = true;
+ path = "${sources.home-manager}";
+ };
+ };
+ imports = with sources; [
# Default profile with default configuration
./modules/module-list.nix
# Set the machine to home
diff --git a/machines/wakasu.nixos.nix b/machines/wakasu.nixos.nix
@@ -1,4 +1,7 @@
-{ config, pkgs, ... }:
+{ sources ? import ../nix/sources.nix
+, pkgs ? import sources.nixos { }
+, ...
+}:
with import ../assets/machines.nix; {
imports = [ ../hardware/lenovo-p50.nix ./home.nixos.nix ];
diff --git a/modules/profiles/nix-config.nixos.nix b/modules/profiles/nix-config.nixos.nix
@@ -1,4 +1,4 @@
-{ config, lib, pkgs, ... }:
+{ sources ? import ../../nix/sources.nix, config, lib, pkgs, ... }:
with lib;
let
@@ -46,6 +46,7 @@ in
dates = cfg.gcDates;
options = "--delete-older-than ${cfg.olderThan}";
};
+ nixPath = [ "nixpkgs=${sources.nixos}" "nixos-config=/etc/nixos/configuration.nix" ];
# if hydra is down, don't wait forever
extraOptions = ''
connect-timeout = 20
diff --git a/nix/sources.json b/nix/sources.json
@@ -53,10 +53,10 @@
"homepage": "https://github.com/NixOS/nixpkgs",
"owner": "NixOS",
"repo": "nixpkgs-channels",
- "rev": "17812e653d89c46d68b7b10e290b1c16758f4e47",
- "sha256": "1zcb70dyfqc8l2ywpbvxmpfshapdi0g365m3rhmwpagqg47pnyxs",
+ "rev": "a0d7927a8c723646f0ddb37164c026adeef975e0",
+ "sha256": "0if84qhhqp4wpqr0c92xiq6i3gbanl99symk7ahaw8wgz51y2924",
"type": "tarball",
- "url": "https://github.com/NixOS/nixpkgs-channels/archive/17812e653d89c46d68b7b10e290b1c16758f4e47.tar.gz",
+ "url": "https://github.com/NixOS/nixpkgs-channels/archive/a0d7927a8c723646f0ddb37164c026adeef975e0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
diff --git a/tasks.org b/tasks.org
@@ -233,6 +233,10 @@
+ … as the machines would have the exact same /channels/ as the ci
- This would allow to run =nixos-rebuild switch= as a user without the mess of channels
+#+begin_src nix
+nix.nixPath = [ "nixpkgs=${sources.nixos}" ];
+#+end_src
+
** TODO self-contained configuration
- Pin different channels in the configuration (?)