From 2ec4b32561954a3fbee2a017c2d84483cae3312a Mon Sep 17 00:00:00 2001 From: Tobias Ostner Date: Tue, 28 Nov 2023 08:32:08 +0100 Subject: [PATCH] Substitute out nix core settings --- .config/nix/flake.lock | 29 +++++++++++++++++++------- .config/nix/flake.nix | 26 +++++++++++++++++------ .config/nix/modules/darwin/default.nix | 4 ---- .config/nix/modules/nix-core.nix | 6 ++++++ 4 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 .config/nix/modules/nix-core.nix diff --git a/.config/nix/flake.lock b/.config/nix/flake.lock index 3e17d5b..2a0b5b6 100644 --- a/.config/nix/flake.lock +++ b/.config/nix/flake.lock @@ -3,7 +3,7 @@ "darwin": { "inputs": { "nixpkgs": [ - "nixpkgs" + "nixpkgs-darwin" ] }, "locked": { @@ -23,7 +23,7 @@ "home-manager": { "inputs": { "nixpkgs": [ - "nixpkgs" + "nixpkgs-darwin" ] }, "locked": { @@ -43,16 +43,30 @@ }, "nixpkgs": { "locked": { - "lastModified": 1698931758, - "narHash": "sha256-pwl9xS9JFMXXR1lUP/QOqO9hiZKukEcVUU1A0DKQwi4=", + "lastModified": 1700977043, + "narHash": "sha256-tX4d36Bq75NBjnYGaCO9b403VDpdFa99NtdUPQ4EALk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "abbe047fb8a5a7074b6de24cced0dbdb27ea0ea8", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs-darwin": { + "locked": { + "lastModified": 1701088922, + "narHash": "sha256-TZo37reWHGhII5hYtvBPsovQtd+I5XivUENhqQjNw3c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b644d97bda6dae837d577e28383c10aa51e5e2d2", + "rev": "fa1c8834c9fe613fe3f84d6c524bb1779e50cd6e", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-unstable", + "ref": "nixpkgs-23.11-darwin", "repo": "nixpkgs", "type": "github" } @@ -61,7 +75,8 @@ "inputs": { "darwin": "darwin", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-darwin": "nixpkgs-darwin" } } }, diff --git a/.config/nix/flake.nix b/.config/nix/flake.nix index 5809153..dda66c1 100644 --- a/.config/nix/flake.nix +++ b/.config/nix/flake.nix @@ -1,12 +1,24 @@ { - nixConfig.experimental-features = [ "nix-command" "flakes" ]; + nixConfig = { + substituters = [ + "https://mirrors.ustc.edu.cn/nix-channels/store" + "https://cache.nixos.org" + ]; + }; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - home-manager.url = "github:nix-community/home-manager/master"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - darwin.url = "github:lnl7/nix-darwin"; - darwin.inputs.nixpkgs.follows = "nixpkgs"; + # nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.11-darwin"; + + darwin = { + url = "github:lnl7/nix-darwin"; + inputs.nixpkgs.follows = "nixpkgs-darwin"; + }; + + home-manager = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs-darwin"; + }; }; outputs = inputs@{ nixpkgs, home-manager, darwin, ... }: { @@ -19,12 +31,14 @@ }; modules = [ + ./modules/nix-core.nix ./modules/darwin home-manager.darwinModules.home-manager { home-manager = { useGlobalPkgs = true; useUserPackages = true; + extraSpecialArgs = inputs; users.tobi.imports = [ ./modules/home-manager ]; }; } diff --git a/.config/nix/modules/darwin/default.nix b/.config/nix/modules/darwin/default.nix index 4bd263a..3e543ba 100644 --- a/.config/nix/modules/darwin/default.nix +++ b/.config/nix/modules/darwin/default.nix @@ -1,5 +1,4 @@ ({ pkgs, ... }: { - services.nix-daemon.enable = true; programs.zsh.enable = true; @@ -21,9 +20,6 @@ ]; }) ]; - nix.extraOptions = '' - experimental-features = nix-command flakes - ''; system.defaults = { dock.autohide = true; diff --git a/.config/nix/modules/nix-core.nix b/.config/nix/modules/nix-core.nix new file mode 100644 index 0000000..c955346 --- /dev/null +++ b/.config/nix/modules/nix-core.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + services.nix-daemon.enable = true; + programs.nix-index.enable = true; +}