From 73e80160be0869d79bd8dda17899543732caf996 Mon Sep 17 00:00:00 2001 From: sefidel Date: Sat, 4 Mar 2023 19:17:15 +0900 Subject: feat(nixos/modules): rename flake -> flakes --- nixos/modules/default.nix | 2 +- nixos/modules/flake.nix | 35 ----------------------------------- nixos/modules/flakes.nix | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 nixos/modules/flake.nix create mode 100644 nixos/modules/flakes.nix (limited to 'nixos') diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 4469650..df11f91 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -1,6 +1,6 @@ { cachix = import ./cachix; - flake = import ./flake.nix; + flakes = import ./flakes.nix; nix = import ./nix.nix; security = import ./security.nix; } diff --git a/nixos/modules/flake.nix b/nixos/modules/flake.nix deleted file mode 100644 index 76f89f3..0000000 --- a/nixos/modules/flake.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, pkgs, unstable, unstable-small, nixpkgs-2211, lib, ... }: - -let - base = "/etc/nixpkgs/channels"; - nixpkgsPath = "${base}/nixpkgs"; - nixpkgsSmallPath = "${base}/nixpkgsSmall"; - nixpkgs2211Path = "${base}/nixpkgs2211"; -in -{ - options.nix.flakes.enable = lib.mkEnableOption "nix flakes"; - - config = lib.mkIf config.nix.flakes.enable { - nix = { - package = pkgs.nixUnstable; - experimentalFeatures = "nix-command flakes"; - - registry.nixpkgs.flake = unstable; - registry.nixpkgsSmall.flake = unstable-small; - registry.nixpkgs2211.flake = nixpkgs-2211; - - nixPath = [ - "nixpkgs=${nixpkgsPath}" - "nixpkgsSmall=${nixpkgsSmallPath}" - "nixpkgs2211=${nixpkgs2211Path}" - "/nix/var/nix/profiles/per-user/root/channels" - ]; - }; - - systemd.tmpfiles.rules = [ - "L+ ${nixpkgsPath} - - - - ${unstable}" - "L+ ${nixpkgsSmallPath} - - - - ${unstable-small}" - "L+ ${nixpkgs2211Path} - - - - ${nixpkgs-2211}" - ]; - }; -} diff --git a/nixos/modules/flakes.nix b/nixos/modules/flakes.nix new file mode 100644 index 0000000..76f89f3 --- /dev/null +++ b/nixos/modules/flakes.nix @@ -0,0 +1,35 @@ +{ config, pkgs, unstable, unstable-small, nixpkgs-2211, lib, ... }: + +let + base = "/etc/nixpkgs/channels"; + nixpkgsPath = "${base}/nixpkgs"; + nixpkgsSmallPath = "${base}/nixpkgsSmall"; + nixpkgs2211Path = "${base}/nixpkgs2211"; +in +{ + options.nix.flakes.enable = lib.mkEnableOption "nix flakes"; + + config = lib.mkIf config.nix.flakes.enable { + nix = { + package = pkgs.nixUnstable; + experimentalFeatures = "nix-command flakes"; + + registry.nixpkgs.flake = unstable; + registry.nixpkgsSmall.flake = unstable-small; + registry.nixpkgs2211.flake = nixpkgs-2211; + + nixPath = [ + "nixpkgs=${nixpkgsPath}" + "nixpkgsSmall=${nixpkgsSmallPath}" + "nixpkgs2211=${nixpkgs2211Path}" + "/nix/var/nix/profiles/per-user/root/channels" + ]; + }; + + systemd.tmpfiles.rules = [ + "L+ ${nixpkgsPath} - - - - ${unstable}" + "L+ ${nixpkgsSmallPath} - - - - ${unstable-small}" + "L+ ${nixpkgs2211Path} - - - - ${nixpkgs-2211}" + ]; + }; +} -- cgit 1.4.1