Commit 342ad917229c

Vincent Demeester <vincent@sbr.pm>
2021-10-29 17:58:27
users/vincent: use nixosConfig in modules…
… to detect how the main NixOS is configured. We start with loading i3.nix conditionnally. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 737a665
Changed files (2)
users
users/vincent/desktop/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, nixosConfig, ... }:
+{ lib, pkgs, nixosConfig, ... }:
 
 {
   imports = [
@@ -6,14 +6,10 @@
     ./finances.nix
     ./firefox.nix
     ./gtk.nix
-    #    ./i3.nix
     ./keyboard.nix
     ./mpv.nix
-    #    ./mpd.nix
-    #    ./redshift.nix
     ./spotify.nix
-    #./xsession.nix
-  ];
+  ] ++ lib.optionals nixosConfig.profiles.desktop.i3.enable [ ./i3.nix ];
   home.sessionVariables = { WEBKIT_DISABLE_COMPOSITING_MODE = 1; };
   home.packages = with pkgs; [
     aspell
@@ -24,47 +20,22 @@
     hunspellDicts.en_GB-ize
     hunspellDicts.fr-any
     libreoffice-fresh
-    #wmctrl
-    #xclip
     xdg-user-dirs
     xdg_utils
     xsel
-    # TODO make this an option
     obs-studio
-    # FIXME move this elsewhere
     signal-desktop
     keybase
-    # pass
     profile-sync-daemon
     youtube-dl
     my.batzconverter
     mpw
   ]; # ++ lib.optionals nixosConfig.profiles.desktop.i3.enable [ pkgs.brave ];
 
-  # xdg.configFile."obs-studio/plugins/obs-v4l2sink/bin/64bit/obs-v4l2sink.so".source =
-  #   "${pkgs.obs-v4l2sink}/share/obs/obs-plugins/v4l2sink/bin/64bit/v4l2sink.so";
   home.file.".XCompose".source = ./xorg/XCompose;
   # home.file.".Xmodmap".source = ./xorg/Xmodmap;
   xdg.configFile."xorg/emoji.compose".source = ./xorg/emoji.compose;
   xdg.configFile."xorg/parens.compose".source = ./xorg/parens.compose;
   xdg.configFile."xorg/modletters.compose".source = ./xorg/modletters.compose;
   home.file.".local/share/applications/google-meet.desktop".source = ./xorg/google-meet.desktop;
-
-  /*
-    xdg.configFile."nr/desktop" = {
-    text = builtins.toJSON [
-    { cmd = "peek"; }
-    { cmd = "shutter"; }
-    { cmd = "station"; }
-    { cmd = "dmenu"; }
-    { cmd = "sxiv"; }
-    { cmd = "screenkey"; }
-    { cmd = "gimp"; }
-    { cmd = "update-desktop-database"; pkg = "desktop-file-utils"; chan = "unstable"; }
-    { cmd = "lgogdownloader"; chan = "unstable"; }
-    { cmd = "xev"; pkg = "xorg.xev"; }
-    ];
-    onChange = "${pkgs.my.nr}/bin/nr desktop";
-    };
-  */
 }
users/vincent/default.nix
@@ -63,6 +63,9 @@ in
   # To use nixos config in home-manager configuration, use the nixosConfig attr.
   # This make it possible to import the whole configuration, and let each module
   # load their own.
+  # FIXME(vdemeester) using nixosConfig, we can get the NixOS configuration from
+  # the home-manager configuration. This should help play around the conditions
+  # inside each "home-manager" modules instead of here.
   home-manager.users.vincent = lib.mkMerge
     (
       [
@@ -77,7 +80,7 @@ in
       ]
       ++ optionals config.profiles.desktop.enable [ (import ./desktop) ]
       ++ optionals config.profiles.desktop.gnome.enable [ (import ./desktop/gnome.nix) ]
-      ++ optionals config.profiles.desktop.i3.enable [ (import ./desktop/i3.nix) ]
+      # ++ optionals config.profiles.desktop.i3.enable [ (import ./desktop/i3.nix) ]
       ++ optionals (config.networking.hostName == "wakasu") [
         {
           home.packages = with pkgs; [