Commit e76f08b20896

Vincent Demeester <vincent@sbr.pm>
2020-12-18 13:18:09
nix: move pkgs to nix/packages
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 831776d
nix/overlays/infra.nix
@@ -0,0 +1,5 @@
+self: super:
+
+{
+  systemd-email = super.callPackage ../packages/systemd-email { };
+}
pkgs/ape/default.nix → nix/packages/ape/default.nix
File renamed without changes
pkgs/athens/default.nix → nix/packages/athens/default.nix
File renamed without changes
pkgs/batzconverter/default.nix → nix/packages/batzconverter/default.nix
File renamed without changes
pkgs/buildkit/default.nix → nix/packages/buildkit/default.nix
File renamed without changes
pkgs/buildx/default.nix → nix/packages/buildx/default.nix
File renamed without changes
pkgs/containerd/default.nix → nix/packages/containerd/default.nix
File renamed without changes
pkgs/crc/patches/1_10.patch → nix/packages/crc/patches/1_10.patch
File renamed without changes
pkgs/crc/patches/1_11.patch → nix/packages/crc/patches/1_11.patch
File renamed without changes
pkgs/crc/patches/1_9.patch → nix/packages/crc/patches/1_9.patch
File renamed without changes
pkgs/crc/default.nix → nix/packages/crc/default.nix
File renamed without changes
pkgs/envbox/default.nix → nix/packages/envbox/default.nix
File renamed without changes
pkgs/esc/default.nix → nix/packages/esc/default.nix
File renamed without changes
pkgs/esc/deps.nix → nix/packages/esc/deps.nix
File renamed without changes
pkgs/fhs/std.nix → nix/packages/fhs/std.nix
File renamed without changes
pkgs/gnome/extensions/bluetooth-quick-connect/default.nix → nix/packages/gnome/extensions/bluetooth-quick-connect/default.nix
File renamed without changes
pkgs/gnome/extensions/hide-top-bar/default.nix → nix/packages/gnome/extensions/hide-top-bar/default.nix
File renamed without changes
pkgs/gnome/extensions/nightthemeswitcher/default.nix → nix/packages/gnome/extensions/nightthemeswitcher/default.nix
File renamed without changes
pkgs/gnome/extensions/noannoyance/default.nix → nix/packages/gnome/extensions/noannoyance/default.nix
File renamed without changes
pkgs/gnome/extensions/shell/default.nix → nix/packages/gnome/extensions/shell/default.nix
File renamed without changes
pkgs/gogo-protobuf/default.nix → nix/packages/gogo-protobuf/default.nix
File renamed without changes
pkgs/gorun/default.nix → nix/packages/gorun/default.nix
File renamed without changes
pkgs/govanityurl/default.nix → nix/packages/govanityurl/default.nix
File renamed without changes
pkgs/ko/default.nix → nix/packages/ko/default.nix
File renamed without changes
pkgs/krew/default.nix → nix/packages/krew/default.nix
File renamed without changes
pkgs/kss/default.nix → nix/packages/kss/default.nix
File renamed without changes
pkgs/kubernix/default.nix → nix/packages/kubernix/default.nix
File renamed without changes
pkgs/manifest-tool/default.nix → nix/packages/manifest-tool/default.nix
File renamed without changes
pkgs/my/scripts/bin/authkey → nix/packages/my/scripts/bin/authkey
File renamed without changes
pkgs/my/scripts/bin/che-inst → nix/packages/my/scripts/bin/che-inst
File renamed without changes
pkgs/my/scripts/bin/chos4 → nix/packages/my/scripts/bin/chos4
File renamed without changes
pkgs/my/scripts/bin/decode-kubernetes-secrets.py → nix/packages/my/scripts/bin/decode-kubernetes-secrets.py
File renamed without changes
pkgs/my/scripts/bin/git-remote-setup → nix/packages/my/scripts/bin/git-remote-setup
File renamed without changes
pkgs/my/scripts/bin/import-photos → nix/packages/my/scripts/bin/import-photos
File renamed without changes
pkgs/my/scripts/bin/knix → nix/packages/my/scripts/bin/knix
File renamed without changes
pkgs/my/scripts/bin/op-inst → nix/packages/my/scripts/bin/op-inst
File renamed without changes
pkgs/my/scripts/bin/pbcopy → nix/packages/my/scripts/bin/pbcopy
File renamed without changes
pkgs/my/scripts/bin/pbpaste → nix/packages/my/scripts/bin/pbpaste
File renamed without changes
pkgs/my/scripts/bin/redhat-vpn → nix/packages/my/scripts/bin/redhat-vpn
File renamed without changes
pkgs/my/scripts/bin/shot → nix/packages/my/scripts/bin/shot
File renamed without changes
pkgs/my/scripts/bin/shotf → nix/packages/my/scripts/bin/shotf
File renamed without changes
pkgs/my/scripts/bin/tktl → nix/packages/my/scripts/bin/tktl
File renamed without changes
pkgs/my/scripts/bin/vpnpass → nix/packages/my/scripts/bin/vpnpass
File renamed without changes
pkgs/my/scripts/builder.sh → nix/packages/my/scripts/builder.sh
File renamed without changes
pkgs/my/scripts/default.nix → nix/packages/my/scripts/default.nix
File renamed without changes
pkgs/my/vde-thinkpad/default.nix → nix/packages/my/vde-thinkpad/default.nix
File renamed without changes
pkgs/my/vde-thinkpad/dock → nix/packages/my/vde-thinkpad/dock
File renamed without changes
pkgs/my/vrsync/default.nix → nix/packages/my/vrsync/default.nix
File renamed without changes
pkgs/my/vrsync/foo → nix/packages/my/vrsync/foo
File renamed without changes
pkgs/my/vrsync/vrsync → nix/packages/my/vrsync/vrsync
File renamed without changes
pkgs/nr/default.nix → nix/packages/nr/default.nix
File renamed without changes
pkgs/oc/default.nix → nix/packages/oc/default.nix
File renamed without changes
pkgs/openshift-install/default.nix → nix/packages/openshift-install/default.nix
File renamed without changes
pkgs/operator-sdk/default.nix → nix/packages/operator-sdk/default.nix
File renamed without changes
pkgs/prm/default.nix → nix/packages/prm/default.nix
File renamed without changes
pkgs/protobuild/default.nix → nix/packages/protobuild/default.nix
File renamed without changes
pkgs/ram/default.nix → nix/packages/ram/default.nix
File renamed without changes
pkgs/rmapi/default.nix → nix/packages/rmapi/default.nix
File renamed without changes
pkgs/sec/default.nix → nix/packages/sec/default.nix
File renamed without changes
pkgs/systemd-email/default.nix → nix/packages/systemd-email/default.nix
File renamed without changes
pkgs/systemd-email/systemd-email → nix/packages/systemd-email/systemd-email
File renamed without changes
pkgs/tkn/default.nix → nix/packages/tkn/default.nix
File renamed without changes
pkgs/tkn-oci/default.nix → nix/packages/tkn-oci/default.nix
File renamed without changes
pkgs/toolbox/default.nix → nix/packages/toolbox/default.nix
File renamed without changes
pkgs/vscodeliveshare/default.nix → nix/packages/vscodeliveshare/default.nix
File renamed without changes
pkgs/yak/default.nix → nix/packages/yak/default.nix
File renamed without changes
pkgs/yaspell/default.nix → nix/packages/yaspell/default.nix
File renamed without changes
pkgs/default.nix → nix/packages/default.nix
File renamed without changes
pkgs/README.org → nix/packages/README.org
File renamed without changes
overlays/sbr.nix
@@ -3,18 +3,18 @@ let
   compileEmacsFiles = super.callPackage ./emacs/builder.nix;
 in
 rec {
-  scripts = import ../pkgs/my/scripts {
+  scripts = import ../nix/packages/my/scripts {
     inherit (self) stdenv;
   };
-  vrsync = import ../pkgs/my/vrsync {
+  vrsync = import ../nix/packages/my/vrsync {
     inherit (self) stdenv lib;
   };
-  vde-thinkpad = import ../pkgs/my/vde-thinkpad {
+  vde-thinkpad = import ../nix/packages/my/vde-thinkpad {
     inherit (self) stdenv lib;
   };
   bekind = super.callPackage ../tools/bekind { };
 
-  my = import ../pkgs {
+  my = import ../nix/packages {
     inherit (self) pkgs;
   };
 
systems/hosts/foo.flake.nix
@@ -49,6 +49,7 @@ in
     '';
   };
 
+  environment.systemPackages = with pkgs; [ tkn ];
   /*
   profiles = {
     desktop.i3.enable = true;
systems/profiles/base.nix
@@ -1,6 +1,6 @@
 { config, lib, pkgs, ... }:
 let
-  inherit (lib) mkEnableOption mkIf;
+  inherit (lib) mkEnableOption mkIf mkDefault mkOverride;
   cfg = config.profiles.base;
 in
 {
@@ -10,7 +10,30 @@ in
     };
   };
   config = mkIf cfg.enable {
+    # Use systemd-boot by default, can be overridden by configurations
+    boot.loader.systemd-boot.enable = mkDefault true;
     # `nix-daemon` will hit the stack limit when using `nixFlakes`.
     systemd.services.nix-daemon.serviceConfig."LimitSTACK" = "infinity";
+    environment = {
+      variables = {
+        EDITOR = mkOverride 0 "vim";
+      };
+    };
+    # Make sure we never remove SSH_AUTH_SOCK when reseting env through sudo
+    security.sudo.extraConfig = ''
+      Defaults env_keep += SSH_AUTH_SOCK
+    '';
+    # Setup a *mailer* in case of failure in systemd
+    systemd.services."status-email-root@" = {
+      description = "status email for %i to vincent";
+      serviceConfig = {
+        Type = "oneshot";
+        ExecStart = ''
+          ${pkgs.systemd-email}/bin/systemd-email vincent@demeester.fr %i
+        '';
+        User = "root";
+        Environment = "PATH=/run/current-system/sw/bin";
+      };
+    };
   };
 }
tools/gnus/init.el
@@ -169,21 +169,21 @@
 ;; -GnusSummary
 
 ;; GnusWin
-(use-package gnus-win
-  :config
-  (gnus-add-configuration
-   '(article
-     (horizontal 1.0
-                 (vertical 40 (group 1.0))
-                 (vertical 1.0
-                           (summary 0.16 point)
-                           (article 1.0)))))
-
-  (gnus-add-configuration
-   '(summary
-     (horizontal 1.0
-                 (vertical 40 (group 1.0))
-                 (vertical 1.0 (summary 1.0 point))))))
+;; (use-package gnus-win
+;;   :config
+;;   (gnus-add-configuration
+;;    '(article
+;;      (horizontal 1.0
+;;                  (vertical 40 (group 1.0))
+;;                  (vertical 1.0
+;;                            (summary 0.16 point)
+;;                            (article 1.0)))))
+;;
+;;   (gnus-add-configuration
+;;    '(summary
+;;      (horizontal 1.0
+;;                  (vertical 40 (group 1.0))
+;;                  (vertical 1.0 (summary 1.0 point))))))
 ;; -GnusWin
 
 ;; GnusDired
users/vincent/desktop/i3.nix
@@ -185,6 +185,7 @@ in
       keybindings = {
         "Mod4+Return" = "exec alacritty";
         "Mod4+Shift+Return" = "exec emacsclient -c";
+        "Mod4+Control+Return" = "exec emacs";
       };
       gaps = {
         inner = 0;
ci.nix
@@ -33,7 +33,7 @@ let
     in
     concatMap f (attrValues s);
   outputsOf = p: map (o: p.${o}) p.outputs;
-  nurAttrs = p: import ./pkgs/default.nix { pkgs = p; };
+  nurAttrs = p: import ./nix/packages/default.nix { pkgs = p; };
   nurPkgs = p:
     flattenPkgs (
       listToAttrs (
flake.nix
@@ -210,6 +210,7 @@
         overlays = forEachSystem (system: [
           (self.overlay."${system}")
           (_: _: import inputs.gitignore-nix { lib = inputs.nixpkgs.lib; })
+          (import ./nix/overlays/infra.nix)
         ]);
       };
 
@@ -261,22 +262,25 @@
 
       # Expose the packages defined in this flake, built for any supported systems. These are
       # meant to be consumed by other projects that might import this flake.
+      #
+      # Internal packages are handled through overlay definition, in internal.
+      # Note: they are also added to the systems overlay so there is no duplication of definition.
       packages = forEachSystem
         (system:
           let
             pkgs = pkgsBySystem."${system}";
           in
           {
-            apeStable = stablePkgsBySystem."${system}".callPackage ./pkgs/ape { };
-            apeUnstable = unstablePkgsBySystem."${system}".callPackage ./pkgs/ape { };
-            ape = pkgs.callPackage ./pkgs/ape { };
-            nr = pkgs.callPackage ./pkgs/nr { };
-            ram = pkgs.callPackage ./pkgs/ram { };
-            systemd-email = pkgs.callPackage ./pkgs/systemd-email { };
+            apeStable = stablePkgsBySystem."${system}".callPackage ./nix/packages/ape { };
+            apeUnstable = unstablePkgsBySystem."${system}".callPackage ./nix/packages/ape { };
+            ape = pkgs.callPackage ./nix/packages/ape { };
+            nr = pkgs.callPackage ./nix/packages/nr { };
+            ram = pkgs.callPackage ./nix/packages/ram { };
+            systemd-email = pkgs.callPackage ./nix/packages/systemd-email { };
 
-            batzconverter = pkgs.callPackage ./pkgs/batzconverter { };
+            batzconverter = pkgs.callPackage ./nix/packages/batzconverter { };
             # Tekton
-            inherit (pkgs.callPackage ./pkgs/tkn { })
+            inherit (pkgs.callPackage ./nix/packages/tkn { })
               tkn_0_11
               tkn_0_12
               tkn_0_13
@@ -284,13 +288,13 @@
               tkn
               ;
 
-            manifest-tool = pkgs.callPackage ./pkgs/manifest-tool { };
-            ko = pkgs.callPackage ./pkgs/ko { };
-            buildx = pkgs.callPackage ./pkgs/buildx { };
-            buildkit = pkgs.callPackage ./pkgs/buildkit { };
+            manifest-tool = pkgs.callPackage ./nix/packages/manifest-tool { };
+            ko = pkgs.callPackage ./nix/packages/ko { };
+            buildx = pkgs.callPackage ./nix/packages/buildx { };
+            buildkit = pkgs.callPackage ./nix/packages/buildkit { };
           } // optionalAttrs (system == "x86_64-linux") {
             # OpenShift
-            inherit (pkgs.callPackage ./pkgs/oc { })
+            inherit (pkgs.callPackage ./nix/packages/oc { })
               oc_4_1
               oc_4_2
               oc_4_3
@@ -299,7 +303,7 @@
               oc_4_6
               oc
               ;
-            inherit (pkgs.callPackage ./pkgs/openshift-install { })
+            inherit (pkgs.callPackage ./nix/packages/openshift-install { })
               openshift-install_4_3
               openshift-install_4_4
               openshift-install_4_5