From 335385ec1d13478a20fc22868bf43fa2da352571 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Sun, 22 Sep 2024 01:47:19 +0200 Subject: [PATCH] nix: remove channels fully --- modules/system/nix/module.nix | 29 ++++++++++++++++------------- modules/system/nix/registry.nix | 11 +---------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/modules/system/nix/module.nix b/modules/system/nix/module.nix index 5a26f16..c00dd46 100644 --- a/modules/system/nix/module.nix +++ b/modules/system/nix/module.nix @@ -6,7 +6,7 @@ pkgs, ... }: let - inherit (lib) mapAttrsToList; + inherit (lib) mapAttrsToList mkForce; in { imports = [ ./documentation.nix # nixos documentation @@ -16,9 +16,14 @@ in { inputs.lix-module.nixosModules.default ]; + # link a copy of our nixpkgs input as the nixpkgs channel + # environment.etc."nix/flake-channels/nixpkgs".source = inputs.nixpkgs; nix = { package = pkgs.lix; + # fuck channels, no thanks + channel.enable = mkForce false; + # This will additionally add your inputs to the system's legacy channels # Making legacy nix commands consistent as well nixPath = mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; @@ -147,18 +152,16 @@ in { }; systemd.services = { + # WE DONT WANT TO BUILD STUFF ON TMPFS + # ITS NOT A GOOD IDEA + nix-daemon = { + environment.TMPDIR = "/var/tmp"; + }; - # WE DONT WANT TO BUILD STUFF ON TMPFS - # ITS NOT A GOOD IDEA - nix-daemon = { - - environment.TMPDIR = "/var/tmp"; - }; - - # Do not run garbage collection on AC power. - # This makes a quite nice difference in battery life. - nix-gc = { - unitConfig.ConditionACPower = true; - }; + # Do not run garbage collection on AC power. + # This makes a quite nice difference in battery life. + nix-gc = { + unitConfig.ConditionACPower = true; + }; }; } diff --git a/modules/system/nix/registry.nix b/modules/system/nix/registry.nix index d1497e0..a166ba4 100644 --- a/modules/system/nix/registry.nix +++ b/modules/system/nix/registry.nix @@ -1,18 +1,9 @@ -{inputs, ...}: let - inherit (inputs) nixpkgs; - nixpkgsPath = nixpkgs.outPath; -in { +{inputs, ...}: { # Big thanks to Dianimo for this! nix = { registry = { nixpkgs.flake = inputs.nixpkgs; default.flake = inputs.nixpkgs; }; - - nixPath = [ - "nixpkgs=${nixpkgsPath}" - "n=${nixpkgsPath}" - "default=${nixpkgsPath}" - ]; }; }