Commit 6c5f419d7d4e

Vincent Demeester <vincent@sbr.pm>
2020-06-06 18:31:33
systems: move modules and hardware to it…
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 2cb6894
modules/profiles/fish.nix
@@ -1,28 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-let
-  cfg = config.profiles.fish;
-in
-{
-  options = {
-    profiles.fish = {
-      enable = mkOption {
-        default = false;
-        description = "Enable fish profile";
-        type = types.bool;
-      };
-    };
-  };
-  config = mkIf cfg.enable {
-    programs.fish = {
-      enable = true;
-      promptInit = ''
-        source /etc/fish/functions/fish_prompt.fish
-        source /etc/fish/functions/fish_right_prompt.fish
-      '';
-    };
-    environment.etc."fish/functions/fish_prompt.fish".source = ./assets/fish/fish_prompt.fish;
-    environment.etc."fish/functions/fish_right_prompt.fish".source = ./assets/fish/fish_right_prompt.fish;
-  };
-}
modules/profiles/nix-config.nix
@@ -1,92 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-let
-  sources = import ../../nix/sources.nix;
-  cfg = config.profiles.nix-config;
-in
-{
-  options = {
-    profiles.nix-config = {
-      enable = mkOption {
-        default = true;
-        description = "Enable nix-config profile";
-        type = types.bool;
-      };
-      gcDates = mkOption {
-        default = "weekly";
-        description = "Specification (in the format described by systemd.time(7)) of the time at which the garbage collector will run. ";
-        type = types.str;
-      };
-      olderThan = mkOption {
-        default = "15d";
-        description = "Number of day to keep when garbage collect";
-        type = types.str;
-      };
-      buildCores = mkOption {
-        type = types.int;
-        default = 2;
-        example = 4;
-        description = ''
-          Maximum number of concurrent tasks during one build.
-        '';
-      };
-      localCaches = mkOption {
-        default = [ "http://nix.cache.home" ];
-        description = "List of local nix caches";
-        type = types.listOf types.str;
-      };
-    };
-  };
-  config = mkIf cfg.enable {
-    nix = {
-      buildCores = cfg.buildCores;
-      useSandbox = true;
-      gc = {
-        automatic = true;
-        dates = cfg.gcDates;
-        options = "--delete-older-than ${cfg.olderThan}";
-      };
-      nixPath = [
-        "nixpkgs=${sources.nixos}"
-        "nixos-config=/etc/nixos/configuration.nix"
-        "nixpkgs-overlays=/etc/nixos/overlays/compat"
-      ];
-      # if hydra is down, don't wait forever
-      extraOptions = ''
-        connect-timeout = 20
-        build-cores = 0
-        keep-outputs = true
-        keep-derivations = true
-      '';
-      binaryCaches = cfg.localCaches ++ [
-        "https://cache.nixos.org/"
-        "https://r-ryantm.cachix.org"
-        "https://vdemeester.cachix.org"
-        "https://shortbrain.cachix.org"
-      ];
-      binaryCachePublicKeys = [
-        "r-ryantm.cachix.org-1:gkUbLkouDAyvBdpBX0JOdIiD2/DP1ldF3Z3Y6Gqcc4c="
-        "vdemeester.cachix.org-1:uCECG6so7v1rs77c5NFz2dCePwd+PGNeZ6E5DrkT7F0="
-        "shortbrain.cachix.org-1:dqXcXzM0yXs3eo9ChmMfmob93eemwNyhTx7wCR4IjeQ="
-        "mic92.cachix.org-1:gi8IhgiT3CYZnJsaW7fxznzTkMUOn1RY4GmXdT/nXYQ="
-      ];
-      trustedUsers = [ "root" "vincent" ];
-    };
-    nixpkgs = {
-      overlays = [
-        (import ../../overlays/sbr.nix)
-        (import ../../overlays/unstable.nix)
-        (import ../../nix).emacs
-      ];
-      config = {
-        allowUnfree = true;
-        packageOverrides = pkgs: {
-          nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
-            inherit pkgs;
-          };
-        };
-      };
-    };
-  };
-}
hardware/dell-latitude-e6540.nix → systems/hardware/dell-latitude-e6540.nix
File renamed without changes
hardware/gigabyte-brix.nix → systems/hardware/gigabyte-brix.nix
File renamed without changes
hardware/lenovo-p50.nix → systems/hardware/lenovo-p50.nix
@@ -1,6 +1,6 @@
 { config, pkgs, lib, ... }:
 let
-  sources = import ../nix/sources.nix;
+  sources = import ../../nix/sources.nix;
 in
 {
   imports = [
hardware/thinkpad-t460s.nix → systems/hardware/thinkpad-t460s.nix
@@ -1,6 +1,6 @@
 { config, pkgs, ... }:
 let
-  sources = import ../nix/sources.nix;
+  sources = import ../../nix/sources.nix;
 in
 {
   imports = [
hardware/thinkpad-x220.nix → systems/hardware/thinkpad-x220.nix
@@ -1,6 +1,6 @@
 { config, pkgs, ... }:
 let
-  sources = import ../nix/sources.nix;
+  sources = import ../../nix/sources.nix;
 in
 {
   imports = [
hardware/thinkpad.nix → systems/hardware/thinkpad.nix
@@ -1,6 +1,6 @@
 { config, pkgs, ... }:
 let
-  sources = import ../nix/sources.nix;
+  sources = import ../../nix/sources.nix;
 in
 {
   imports = [ (sources.nixos-hardware + "/lenovo/thinkpad") ];
modules/core/default.nix → systems/modules/core/default.nix
@@ -1,6 +1,6 @@
 {
   imports = [
-    (import ../../nix).home-manager
+    (import ../../../nix).home-manager
     ./home-manager.nix
     ./nix.nix
     ./nur.nix
modules/core/home-manager.nix → systems/modules/core/home-manager.nix
File renamed without changes
modules/core/nix.nix → systems/modules/core/nix.nix
@@ -83,10 +83,10 @@ in
 
     nixpkgs = {
       overlays = [
-        (import ../../overlays/mkSecret.nix)
-        (import ../../overlays/sbr.nix)
-        (import ../../overlays/unstable.nix)
-        (import ../../nix).emacs
+        (import ../../../overlays/mkSecret.nix)
+        (import ../../../overlays/sbr.nix)
+        (import ../../../overlays/unstable.nix)
+        (import ../../../nix).emacs
       ];
       config = {
         allowUnfree = true;
@@ -95,7 +95,7 @@ in
     system = {
       extraSystemBuilderCmds = ''
         ln -sv ${pkgs.path} $out/nixpkgs
-        ln -sv ${../../overlays} $out/overlays
+        ln -sv ${../../../overlays} $out/overlays
       '';
 
       stateVersion = "20.03";
modules/core/nur.nix → systems/modules/core/nur.nix
@@ -13,7 +13,7 @@ in
   config = mkIf cfg.enable {
     nixpkgs.config = {
       packageOverrides = pkgs: {
-        nur = (import ../../nix).nur { inherit pkgs; };
+        nur = (import ../../../nix).nur { inherit pkgs; };
       };
     };
   };
modules/hardware/default.nix → systems/modules/hardware/default.nix
File renamed without changes
modules/hardware/sane-extra-config.nixos.nix → systems/modules/hardware/sane-extra-config.nixos.nix
File renamed without changes
modules/profiles/avahi.nix → systems/modules/profiles/avahi.nix
File renamed without changes
modules/profiles/base.nix → systems/modules/profiles/base.nix
File renamed without changes
modules/profiles/buildkit.nix → systems/modules/profiles/buildkit.nix
File renamed without changes
modules/profiles/containerd.nix → systems/modules/profiles/containerd.nix
File renamed without changes
modules/profiles/default.nix → systems/modules/profiles/default.nix
@@ -8,7 +8,6 @@
     ./desktop.nix
     ./dev.nix
     ./docker.nix
-    ./fish.nix
     ./gaming.nix
     ./git.nix
     ./home.nix
modules/profiles/desktop.nix → systems/modules/profiles/desktop.nix
File renamed without changes
modules/profiles/dev.nix → systems/modules/profiles/dev.nix
File renamed without changes
modules/profiles/docker.nix → systems/modules/profiles/docker.nix
File renamed without changes
modules/profiles/gaming.nix → systems/modules/profiles/gaming.nix
File renamed without changes
modules/profiles/git.nix → systems/modules/profiles/git.nix
File renamed without changes
modules/profiles/home.nix → systems/modules/profiles/home.nix
File renamed without changes
modules/profiles/i18n.nix → systems/modules/profiles/i18n.nix
File renamed without changes
modules/profiles/ipfs.nix → systems/modules/profiles/ipfs.nix
File renamed without changes
modules/profiles/laptop.nix → systems/modules/profiles/laptop.nix
File renamed without changes
modules/profiles/mail.nix → systems/modules/profiles/mail.nix
@@ -3,7 +3,7 @@
 with lib;
 let
   cfg = config.profiles.mail;
-  secretPath = ../../secrets/machines.nix;
+  secretPath = ../../../secrets/machines.nix;
   secretCondition = (builtins.pathExists secretPath);
 in
 {
@@ -17,7 +17,7 @@ in
     };
   };
   config = mkIf (cfg.enable && secretCondition) {
-    environment.etc."msmtprc".source = pkgs.mkSecret ../../secrets/msmtprc;
+    environment.etc."msmtprc".source = pkgs.mkSecret ../../../secrets/msmtprc;
     environment.systemPackages = with pkgs; [ msmtp ];
   };
 }
modules/profiles/nix-auto-update.nix → systems/modules/profiles/nix-auto-update.nix
File renamed without changes
modules/profiles/printing.nix → systems/modules/profiles/printing.nix
File renamed without changes
modules/profiles/pulseaudio.nix → systems/modules/profiles/pulseaudio.nix
File renamed without changes
modules/profiles/qemu.nix → systems/modules/profiles/qemu.nix
@@ -34,7 +34,7 @@ in
   };
   config = mkIf (cfg.arm || cfg.aarch64) {
     nixpkgs = {
-      overlays = [ (import ../../overlays/qemu/default.nix) ];
+      overlays = [ (import ../../../overlays/qemu/default.nix) ];
     };
     boot.binfmt.registrations =
       optionalAttrs cfg.arm { inherit arm; }
modules/profiles/scanning.nix → systems/modules/profiles/scanning.nix
File renamed without changes
modules/profiles/ssh.nix → systems/modules/profiles/ssh.nix
File renamed without changes
modules/profiles/syncthing.nix → systems/modules/profiles/syncthing.nix
File renamed without changes
modules/profiles/users.nix → systems/modules/profiles/users.nix
@@ -3,7 +3,7 @@
 with lib;
 let
   cfg = config.profiles.users;
-  secretPath = ../../secrets/machines.nix;
+  secretPath = ../../../secrets/machines.nix;
   secretCondition = (builtins.pathExists secretPath);
 
   isAuthorized = p: builtins.isAttrs p && p.authorized or false;
@@ -51,7 +51,7 @@ in
     }
     (
       mkIf secretCondition {
-        programs.ssh.extraConfig = with import ../../secrets/machines.nix; ''
+        programs.ssh.extraConfig = with import ../../../secrets/machines.nix; ''
           Host kerkouane kerkouane.sbr.pm
             Hostname kerkouane.sbr.pm
             Port ${toString ssh.kerkouane.port}
modules/profiles/virtualization.nix → systems/modules/profiles/virtualization.nix
File renamed without changes
modules/profiles/wireguard.server.nix → systems/modules/profiles/wireguard.server.nix
@@ -4,7 +4,7 @@ with lib;
 let
   cfg = config.profiles.wireguard.server;
 
-  secretPath = ../../secrets/machines.nix;
+  secretPath = ../../../secrets/machines.nix;
   secretCondition = (builtins.pathExists secretPath);
   allowedIPs = lists.optionals secretCondition (import secretPath).wireguard.kerkouane.allowedIPs;
   listenPort = if secretCondition then (import secretPath).wg.listenPort else 0;
modules/profiles/yubikey.nix → systems/modules/profiles/yubikey.nix
File renamed without changes
modules/profiles/zsh.nix → systems/modules/profiles/zsh.nix
File renamed without changes
modules/programs/crc.nix → systems/modules/programs/crc.nix
File renamed without changes
modules/programs/default.nix → systems/modules/programs/default.nix
@@ -1,7 +1,6 @@
 {
   imports = [
     ./crc.nix
-    # Remove "nixos" from here
     ./podman.nix
   ];
 }
modules/programs/podman.nix → systems/modules/programs/podman.nix
File renamed without changes
modules/services/athens.nix → systems/modules/services/athens.nix
File renamed without changes
modules/services/default.nix → systems/modules/services/default.nix
File renamed without changes
modules/services/govanityurl.nix → systems/modules/services/govanityurl.nix
File renamed without changes
modules/services/nix-binary-cache.nix → systems/modules/services/nix-binary-cache.nix
File renamed without changes
modules/services/wireguard.client.nix → systems/modules/services/wireguard.client.nix
File renamed without changes
modules/virtualisation/buildkit.nix → systems/modules/virtualisation/buildkit.nix
File renamed without changes
modules/virtualisation/containerd.nix → systems/modules/virtualisation/containerd.nix
File renamed without changes
modules/virtualisation/default.nix → systems/modules/virtualisation/default.nix
File renamed without changes
modules/default.nix → systems/modules/default.nix
File renamed without changes
systems/hokkaido.nix
@@ -14,8 +14,8 @@ let
 in
 {
   imports = [
-    ../hardware/thinkpad-x220.nix
-    ../modules
+    ./hardware/thinkpad-x220.nix
+    ./modules
     (import ../users).vincent
     (import ../users).root
   ];
systems/kerkouane.nix
@@ -16,7 +16,7 @@ in
 {
   imports = [
     (sources.nixos + "/nixos/modules/profiles/qemu-guest.nix")
-    ../modules
+    ./modules
     (import ../users).vincent
     (import ../users).root
   ]
systems/okinawa.nix
@@ -14,8 +14,8 @@ let
 in
 {
   imports = [
-    ../hardware/gigabyte-brix.nix
-    ../modules
+    ./hardware/gigabyte-brix.nix
+    ./modules
     (import ../users).vincent
     (import ../users).root
   ];
systems/sakhalin.nix
@@ -14,8 +14,8 @@ let
 in
 {
   imports = [
-    ../hardware/gigabyte-brix.nix
-    ../modules
+    ./hardware/gigabyte-brix.nix
+    ./modules
     (import ../users).vincent
     (import ../users).root
   ];
systems/wakasu.nix
@@ -14,8 +14,8 @@ let
 in
 {
   imports = [
-    ../hardware/lenovo-p50.nix
-    ../modules
+    ./hardware/lenovo-p50.nix
+    ./modules
     (import ../users).vincent
     (import ../users).root
   ];