From 44b05768cd7ac8e42fd016fe37938378ff9ba145 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 12:49:30 +0200 Subject: [PATCH 01/51] flake: use explicit input definitions --- flake.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index d8e61ee..2dc0f8c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,26 @@ { description = "Nixos configuration with flakes"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - emacs-overlay.url = "github:nix-community/emacs-overlay/master"; + nixpkgs = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-20.09"; + }; + + nixpkgs-unstable = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-unstable"; + }; + + emacs-overlay = { + type = "github"; + owner = "nix-community"; + repo = "emacs-overlay"; + ref = "master"; + }; }; outputs = { self, nixpkgs, nixpkgs-unstable, emacs-overlay }: { From 5c86bdd16a67d4663b7f4e885f76944a82c2905f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 13:42:29 +0200 Subject: [PATCH 02/51] home: setup home-manager --- flake.lock | 22 ++++++++++++++++++++++ flake.nix | 17 ++++++++++++++++- home/default.nix | 6 ++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 home/default.nix diff --git a/flake.lock b/flake.lock index 9ea516f..2677d02 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,27 @@ "type": "github" } }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1618789951, + "narHash": "sha256-EoQxcVIiaqjUwwTl1YF3zGnXtzEvOUDL3SBZ8ASELvU=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "6aa6556bcab6dc0f6398b4daa8404d788fd7a6a2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1618149891, @@ -51,6 +72,7 @@ "root": { "inputs": { "emacs-overlay": "emacs-overlay", + "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" } diff --git a/flake.nix b/flake.nix index 2dc0f8c..edb5671 100644 --- a/flake.nix +++ b/flake.nix @@ -21,9 +21,17 @@ repo = "emacs-overlay"; ref = "master"; }; + + home-manager = { + type = "github"; + owner = "nix-community"; + repo = "home-manager"; + ref = "master"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; }; - outputs = { self, nixpkgs, nixpkgs-unstable, emacs-overlay }: { + outputs = { self, nixpkgs, nixpkgs-unstable, emacs-overlay, home-manager }: { nixosConfigurations.poseidon = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; modules = @@ -54,6 +62,13 @@ [ ./boreal.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.alarsyo = import ./home; + } + { nixpkgs.overlays = [ emacs-overlay.overlay diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..5a16987 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + home.stateVersion = "20.09"; + + home.username = "alarsyo"; +} From 73e1ff6c0f735cf26a4a1da22f9e66351cb2e289 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 14:29:38 +0200 Subject: [PATCH 03/51] home: basic i3 setup --- home/default.nix | 4 +++ home/x/default.nix | 10 ++++++ home/x/i3.nix | 77 ++++++++++++++++++++++++++++++++++++++++ hosts/boreal/default.nix | 2 ++ hosts/boreal/home.nix | 7 ++++ 5 files changed, 100 insertions(+) create mode 100644 home/x/default.nix create mode 100644 home/x/i3.nix create mode 100644 hosts/boreal/home.nix diff --git a/home/default.nix b/home/default.nix index 5a16987..1cb28cb 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,5 +1,9 @@ { ... }: { + imports = [ + ./x + ]; + home.stateVersion = "20.09"; home.username = "alarsyo"; diff --git a/home/x/default.nix b/home/x/default.nix new file mode 100644 index 0000000..382e0e5 --- /dev/null +++ b/home/x/default.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, ... }: +{ + imports = [ + ./i3.nix + ]; + + options.my.home.x = with lib; { + enable = mkEnableOption "X server configuration"; + }; +} diff --git a/home/x/i3.nix b/home/x/i3.nix new file mode 100644 index 0000000..ef31cec --- /dev/null +++ b/home/x/i3.nix @@ -0,0 +1,77 @@ +{ config, lib, pkgs, ... }: +let + isEnabled = config.my.home.x.enable; + + myTerminal = + # FIXME: fix when terminal is setup in home + # if config.my.home.terminal.program != null + if true + then "alacritty" + else "i3-sensible-terminal"; + + alt = "Mod1"; # `Alt` key + modifier = "Mod4"; # `Super` key + + logoutMode = "[L]ogout, [S]uspend, [P]oweroff, [R]eboot"; +in +{ + config = lib.mkIf isEnabled { + # FIXME: enable flameshot when added + # my.home = {}; + + xsession.windowManager.i3 = { + enable = true; + + config = { + inherit modifier; + + bars = + [ + { + statusCommand = "i3status"; + position = "top"; + } + ]; + + focus = { + followMouse = true; + mouseWarping = true; + }; + + fonts = [ + "DejaVu Sans Mono 8" + ]; + + keybindings = lib.mkOptionDefault { + "${modifier}+Shift+e" = ''mode "${logoutMode}"''; + }; + + modes = + let + makeModeBindings = attrs: attrs // { + "Escape" = "mode default"; + "Return" = "mode default"; + }; + in + { + "${logoutMode}" = makeModeBindings { + "l" = "exec --no-startup-id i3-msg exit, mode default"; + "s" = "exec --no-startup-id systemctl suspend, mode default"; + "p" = "exec --no-startup-id systemctl poweroff, mode default"; + "r" = "exec --no-startup-id systemctl reboot, mode default"; + }; + }; + + startup = [ + # FIXME: make it conditional on "nvidia" being part of video drivers + { + command = "nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=1'"; + notification = false; + } + ]; + + terminal = myTerminal; + }; + }; + }; +} diff --git a/hosts/boreal/default.nix b/hosts/boreal/default.nix index 71615c6..347132a 100644 --- a/hosts/boreal/default.nix +++ b/hosts/boreal/default.nix @@ -10,6 +10,8 @@ in imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + + ./home.nix ]; # Use the systemd-boot EFI boot loader. diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix new file mode 100644 index 0000000..fe3fea0 --- /dev/null +++ b/hosts/boreal/home.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + home-manager.users.alarsyo = { + # Keyboard settings & i3 settings + my.home.x.enable = true; + }; +} From e00685bdb5573d00881cf8788012182c5f19f9c5 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 14:36:52 +0200 Subject: [PATCH 04/51] home: i3: shortcut to launch emacs --- home/x/i3.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index ef31cec..96076f0 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -44,6 +44,7 @@ in keybindings = lib.mkOptionDefault { "${modifier}+Shift+e" = ''mode "${logoutMode}"''; + "${modifier}+i" = "exec ${pkgs.emacsPgtkGcc}/bin/emacsclient -c"; }; modes = From 4ee7d15cb83b7817fb3342b7eb4e1056f1b04e79 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 14:58:52 +0200 Subject: [PATCH 05/51] home: x: setup i3status-rust --- home/x/default.nix | 1 + home/x/i3.nix | 43 ++++++++++++++++++++++++++++++++++++++++++- home/x/i3bar.nix | 22 ++++++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 home/x/i3bar.nix diff --git a/home/x/default.nix b/home/x/default.nix index 382e0e5..ca92c09 100644 --- a/home/x/default.nix +++ b/home/x/default.nix @@ -2,6 +2,7 @@ { imports = [ ./i3.nix + ./i3bar.nix ]; options.my.home.x = with lib; { diff --git a/home/x/i3.nix b/home/x/i3.nix index 96076f0..5894ce3 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -13,6 +13,17 @@ let modifier = "Mod4"; # `Super` key logoutMode = "[L]ogout, [S]uspend, [P]oweroff, [R]eboot"; + + # colors + colorBg = "#282828"; + colorRed = "#cc241d"; + colorGreen = "#98971a"; + colorYellow = "#d79921"; + colorBlue = "#458588"; + colorPurple = "#b16286"; + colorAqua = "#689d68"; + colorGray = "#a89984"; + colorDarkGray = "#1d2021"; in { config = lib.mkIf isEnabled { @@ -26,10 +37,40 @@ in inherit modifier; bars = + let + barConfigPath = + config.xdg.configFile."i3status-rust/config-top.toml".target; + in [ { - statusCommand = "i3status"; + statusCommand = "i3status-rs ${barConfigPath}"; position = "top"; + + colors = { + background = colorBg; + statusline = colorYellow; + + focusedWorkspace = { + border = colorAqua; + background = colorAqua; + text = colorDarkGray; + }; + inactiveWorkspace = { + border = colorDarkGray; + background = colorDarkGray; + text = colorYellow; + }; + activeWorkspace = { + border = colorAqua; + background = colorDarkGray; + text = colorYellow; + }; + urgentWorkspace = { + border = colorRed; + background = colorRed; + text = colorBg; + }; + }; } ]; diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix new file mode 100644 index 0000000..644a06b --- /dev/null +++ b/home/x/i3bar.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: +let + isEnabled = config.my.home.x.enable; +in +{ + config = lib.mkIf isEnabled { + home.packages = with pkgs; [ + alsaUtils # Used by `sound` block + lm_sensors # Used by `temperature` block + ]; + + programs.i3status-rust = { + enable = true; + + bars = { + top = { + theme = "gruvbox-light"; + }; + }; + }; + }; +} From e3a9db2af02438b5e619c95155e232cf127b9dff Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 15:04:52 +0200 Subject: [PATCH 06/51] flake: make home-manager chatty --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index edb5671..c7f0e9f 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,7 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.alarsyo = import ./home; + home-manager.verbose = true; } { From 6b660a74efef26649b9c3ab12c2e1a72902fadf5 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 15:05:52 +0200 Subject: [PATCH 07/51] home: x: don't use absolute path for commands --- home/x/i3.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/x/i3.nix b/home/x/i3.nix index 5894ce3..ad11ff5 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -85,7 +85,7 @@ in keybindings = lib.mkOptionDefault { "${modifier}+Shift+e" = ''mode "${logoutMode}"''; - "${modifier}+i" = "exec ${pkgs.emacsPgtkGcc}/bin/emacsclient -c"; + "${modifier}+i" = "exec emacsclient -c"; }; modes = From cc34396e9ea9a8607c1184f502077bb8ea9c07af Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 15:42:27 +0200 Subject: [PATCH 08/51] home: move emacs service to home config --- home/default.nix | 1 + home/emacs.nix | 19 +++++++++++++++++++ hosts/boreal/default.nix | 5 ----- hosts/boreal/home.nix | 1 + 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 home/emacs.nix diff --git a/home/default.nix b/home/default.nix index 1cb28cb..c9a4a7e 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./emacs.nix ./x ]; diff --git a/home/emacs.nix b/home/emacs.nix new file mode 100644 index 0000000..7229282 --- /dev/null +++ b/home/emacs.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: +{ + options.my.home.emacs = with lib; { + enable = mkEnableOption "Emacs daemon configuration"; + }; + + config = lib.mkIf config.my.home.emacs.enable { + services.emacs = { + enable = true; + # generate emacsclient desktop file + client.enable = true; + }; + + programs.emacs = { + enable = true; + package = pkgs.emacsPgtkGcc; + }; + }; +} diff --git a/hosts/boreal/default.nix b/hosts/boreal/default.nix index 347132a..f2b13f4 100644 --- a/hosts/boreal/default.nix +++ b/hosts/boreal/default.nix @@ -71,11 +71,6 @@ in layout = "fr"; xkbVariant = "us"; }; - - emacs = { - enable = true; - package = pkgs.emacsPgtkGcc; - }; }; sound.enable = true; diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index fe3fea0..46f1750 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -3,5 +3,6 @@ home-manager.users.alarsyo = { # Keyboard settings & i3 settings my.home.x.enable = true; + my.home.emacs.enable = true; }; } From 52290a8f8d1c4bf38b16dc3621f6fb8d0ab1738c Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 15:51:50 +0200 Subject: [PATCH 09/51] home: setup flameshot --- base/gui-programs.nix | 1 - home/default.nix | 1 + home/flameshot.nix | 13 +++++++++++++ home/x/i3.nix | 5 +++-- 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 home/flameshot.nix diff --git a/base/gui-programs.nix b/base/gui-programs.nix index 62b386c..8d73749 100644 --- a/base/gui-programs.nix +++ b/base/gui-programs.nix @@ -6,7 +6,6 @@ emacsPgtkGcc feh firefox - flameshot pavucontrol slack spotify diff --git a/home/default.nix b/home/default.nix index c9a4a7e..abf442e 100644 --- a/home/default.nix +++ b/home/default.nix @@ -2,6 +2,7 @@ { imports = [ ./emacs.nix + ./flameshot.nix ./x ]; diff --git a/home/flameshot.nix b/home/flameshot.nix new file mode 100644 index 0000000..359fc8c --- /dev/null +++ b/home/flameshot.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: +let + cfg = config.my.home.flameshot; +in +{ + options.my.home.flameshot = with lib; { + enable = mkEnableOption "flameshot autolaunch"; + }; + + config.services.flameshot = lib.mkIf cfg.enable { + enable = true; + }; +} diff --git a/home/x/i3.nix b/home/x/i3.nix index ad11ff5..bafdd36 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -27,8 +27,9 @@ let in { config = lib.mkIf isEnabled { - # FIXME: enable flameshot when added - # my.home = {}; + my.home = { + flameshot.enable = true; + }; xsession.windowManager.i3 = { enable = true; From 9684592fbdc15d1fc1c4197238da6693ed555733 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 16:07:38 +0200 Subject: [PATCH 10/51] home: emacs: move package dependencies in homeconf --- base/gui-programs.nix | 9 ++------- home/emacs.nix | 10 ++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/base/gui-programs.nix b/base/gui-programs.nix index 8d73749..f98fedf 100644 --- a/base/gui-programs.nix +++ b/base/gui-programs.nix @@ -3,22 +3,17 @@ environment.systemPackages = with pkgs; [ alacritty discord - emacsPgtkGcc feh firefox pavucontrol slack spotify - sqlite # needed for org-roam zathura ]; - fonts.fonts = with pkgs; [ - input-fonts - emacs-all-the-icons-fonts - ]; - networking.networkmanager.enable = true; programs.nm-applet.enable = true; + + # NOTE: needed for home emacs configuration nixpkgs.config.input-fonts.acceptLicense = true; } diff --git a/home/emacs.nix b/home/emacs.nix index 7229282..5b1808e 100644 --- a/home/emacs.nix +++ b/home/emacs.nix @@ -5,6 +5,16 @@ }; config = lib.mkIf config.my.home.emacs.enable { + home.packages = with pkgs; [ + sqlite # needed by org-roam + + # fonts used by my config + input-fonts + emacs-all-the-icons-fonts + ]; + # make sure above fonts are discoverable + fonts.fontconfig.enable = true; + services.emacs = { enable = true; # generate emacsclient desktop file From 2151342f5f848cb816d7291bddb210c1d0e5c041 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 16:28:45 +0200 Subject: [PATCH 11/51] home: i3: make status bar font bigger --- home/x/i3.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index bafdd36..780e3c7 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -46,6 +46,7 @@ in { statusCommand = "i3status-rs ${barConfigPath}"; position = "top"; + fonts = [ "DejaVu Sans Mono 9" ]; colors = { background = colorBg; From 17f7df9fc89e181266bffa618d7dd1bc62cf9f96 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 18:59:24 +0200 Subject: [PATCH 12/51] home: tmux: basic setup --- base/programs.nix | 4 ---- home/default.nix | 1 + home/tmux.nix | 14 ++++++++++++++ hosts/boreal/home.nix | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 home/tmux.nix diff --git a/base/programs.nix b/base/programs.nix index 0770768..2de78f9 100644 --- a/base/programs.nix +++ b/base/programs.nix @@ -14,10 +14,6 @@ AddKeysToAgent yes ''; }; - tmux = { - enable = true; - baseIndex = 1; - }; }; environment.systemPackages = with pkgs; [ diff --git a/home/default.nix b/home/default.nix index abf442e..0da2e12 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,6 +3,7 @@ imports = [ ./emacs.nix ./flameshot.nix + ./tmux.nix ./x ]; diff --git a/home/tmux.nix b/home/tmux.nix new file mode 100644 index 0000000..8325fa9 --- /dev/null +++ b/home/tmux.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.home.tmux; +in +{ + options.my.home.tmux = with lib; { + enable = mkEnableOption "tmux dotfiles"; + }; + + config.programs.tmux = lib.mkIf cfg.enable { + enable = true; + baseIndex = 1; + }; +} diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index 46f1750..c39bf22 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -4,5 +4,6 @@ # Keyboard settings & i3 settings my.home.x.enable = true; my.home.emacs.enable = true; + my.home.tmux.enable = true; }; } From 34d6ef1e2f6c4bcecfdb911c709f294c98dbaa42 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 19:01:09 +0200 Subject: [PATCH 13/51] boreal: disable wireguard config for now --- hosts/boreal/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/boreal/default.nix b/hosts/boreal/default.nix index f2b13f4..bd66dcb 100644 --- a/hosts/boreal/default.nix +++ b/hosts/boreal/default.nix @@ -40,7 +40,7 @@ in # List services that you want to enable: my.services = { wireguard = { - enable = true; + enable = false; iface = "wg"; port = 51820; From f3313d39a671ed186e7aa581494c0ef89bdd9eaf Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 19:27:46 +0200 Subject: [PATCH 14/51] home: i3bar: use solarized-light --- home/x/i3bar.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix index 644a06b..2c9e53c 100644 --- a/home/x/i3bar.nix +++ b/home/x/i3bar.nix @@ -14,7 +14,7 @@ in bars = { top = { - theme = "gruvbox-light"; + theme = "solarized-light"; }; }; }; From 39c6f6db3a5bb71524a3851d8b3e6bc9bd5a8aa1 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 19 Apr 2021 22:54:20 +0200 Subject: [PATCH 15/51] home: i3bar: setup blocks --- home/x/i3bar.nix | 50 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix index 2c9e53c..b604b41 100644 --- a/home/x/i3bar.nix +++ b/home/x/i3bar.nix @@ -3,10 +3,12 @@ let isEnabled = config.my.home.x.enable; in { + config = lib.mkIf isEnabled { home.packages = with pkgs; [ - alsaUtils # Used by `sound` block + iw # Used by `net` block lm_sensors # Used by `temperature` block + font-awesome-ttf ]; programs.i3status-rust = { @@ -15,6 +17,52 @@ in bars = { top = { theme = "solarized-light"; + icons = "awesome5"; + + blocks = [ + { + block = "disk_space"; + path = "/"; + alias = "/"; + info_type = "available"; + unit = "GB"; + interval = 60; + warning = 20.0; + alert = 10.0; + } + { + block = "cpu"; + interval = 1; + } + { + block = "temperature"; + collapsed = false; + interval = 10; + format = "{max}°"; + # FIXME: specific to my AMD Ryzen CPU. Make this depend on + # hostname or something else + chip = "k10temp-pci-*"; + inputs = [ "Tccd1" ]; + } + { + block = "networkmanager"; + primary_only = true; + } + { + block = "sound"; + driver = "pulseaudio"; + } + # { + # block = "notify"; + # } + { + block = "time"; + interval = 5; + format = "%a %d/%m %T"; + locale = "fr_FR"; + timezone = "Europe/Paris"; + } + ]; }; }; }; From 8284139b0e523c65a4a9e5565e9027a5666b6a96 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 20 Apr 2021 00:23:26 +0200 Subject: [PATCH 16/51] home: i3: fix font issue in i3 bar see nix-community/home-manager#1937 for details about the issue --- home/x/i3.nix | 2 +- home/x/i3bar.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/home/x/i3.nix b/home/x/i3.nix index 780e3c7..265d029 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -46,7 +46,7 @@ in { statusCommand = "i3status-rs ${barConfigPath}"; position = "top"; - fonts = [ "DejaVu Sans Mono 9" ]; + fonts = [ "DejaVuSansMono" "FontAwesome5Free 9" ]; colors = { background = colorBg; diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix index b604b41..cf678e2 100644 --- a/home/x/i3bar.nix +++ b/home/x/i3bar.nix @@ -8,7 +8,7 @@ in home.packages = with pkgs; [ iw # Used by `net` block lm_sensors # Used by `temperature` block - font-awesome-ttf + font-awesome ]; programs.i3status-rust = { From 97a2a0e6e51f816383e5ed539c72c2caf5a0ff7b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 20 Apr 2021 00:38:08 +0200 Subject: [PATCH 17/51] home: i3: volume bindings --- home/x/i3.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index 265d029..8d441a0 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -88,6 +88,12 @@ in keybindings = lib.mkOptionDefault { "${modifier}+Shift+e" = ''mode "${logoutMode}"''; "${modifier}+i" = "exec emacsclient -c"; + + # Volume handling + "XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle"; }; modes = From 2f1e12890d43909557f207213267a798e2b9bad2 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 20 Apr 2021 00:47:23 +0200 Subject: [PATCH 18/51] home: i3: setup betterlockscreen --- home/x/i3.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home/x/i3.nix b/home/x/i3.nix index 8d441a0..569e73b 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -31,6 +31,10 @@ in flameshot.enable = true; }; + home.packages = with pkgs; [ + betterlockscreen + ]; + xsession.windowManager.i3 = { enable = true; @@ -94,6 +98,8 @@ in "XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%"; "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + + "${modifier}+l" = "exec --no-startup-id betterlockscreen --lock"; }; modes = @@ -106,7 +112,7 @@ in { "${logoutMode}" = makeModeBindings { "l" = "exec --no-startup-id i3-msg exit, mode default"; - "s" = "exec --no-startup-id systemctl suspend, mode default"; + "s" = "exec --no-startup-id betterlockscreen --suspend, mode default"; "p" = "exec --no-startup-id systemctl poweroff, mode default"; "r" = "exec --no-startup-id systemctl reboot, mode default"; }; From 30e7a384d0e2513217563539fd58869ef12cde2f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 20 Apr 2021 00:47:37 +0200 Subject: [PATCH 19/51] home: i3: keep default resize mode --- home/x/i3.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/home/x/i3.nix b/home/x/i3.nix index 569e73b..452cba4 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -109,14 +109,14 @@ in "Return" = "mode default"; }; in - { - "${logoutMode}" = makeModeBindings { - "l" = "exec --no-startup-id i3-msg exit, mode default"; - "s" = "exec --no-startup-id betterlockscreen --suspend, mode default"; - "p" = "exec --no-startup-id systemctl poweroff, mode default"; - "r" = "exec --no-startup-id systemctl reboot, mode default"; + lib.mkOptionDefault { + "${logoutMode}" = makeModeBindings { + "l" = "exec --no-startup-id i3-msg exit, mode default"; + "s" = "exec --no-startup-id betterlockscreen --suspend, mode default"; + "p" = "exec --no-startup-id systemctl poweroff, mode default"; + "r" = "exec --no-startup-id systemctl reboot, mode default"; + }; }; - }; startup = [ # FIXME: make it conditional on "nvidia" being part of video drivers From 28a296435a82d19afb3be2bd940aca859cf34af9 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 20 Apr 2021 00:52:36 +0200 Subject: [PATCH 20/51] home: i3: assign slack to ws10 --- home/x/i3.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index 452cba4..bdf5a7a 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -127,6 +127,12 @@ in ]; terminal = myTerminal; + + assigns = { + "10" = [ + { class = "Slack"; } + ]; + }; }; }; }; From f6f0cfb3ba40776e886bc2191d585508622cbe20 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 20 Apr 2021 01:05:53 +0200 Subject: [PATCH 21/51] home: i3: finish up theme --- home/x/i3.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index bdf5a7a..e1cb7ed 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -24,6 +24,7 @@ let colorAqua = "#689d68"; colorGray = "#a89984"; colorDarkGray = "#1d2021"; + colorWhite = "#ffffff"; in { config = lib.mkIf isEnabled { @@ -76,10 +77,43 @@ in background = colorRed; text = colorBg; }; + + separator = colorRed; }; } ]; + colors = { + focused = { + border = colorBlue; + background = colorBlue; + text = colorDarkGray; + indicator = colorPurple; + childBorder = colorDarkGray; + }; + focusedInactive = { + border = colorDarkGray; + background = colorDarkGray; + text = colorYellow; + indicator = colorPurple; + childBorder = colorDarkGray; + }; + unfocused = { + border = colorDarkGray; + background = colorDarkGray; + text = colorYellow; + indicator = colorPurple; + childBorder = colorDarkGray; + }; + urgent = { + border = colorRed; + background = colorRed; + text = colorWhite; + indicator = colorRed; + childBorder = colorRed; + }; + }; + focus = { followMouse = true; mouseWarping = true; From 0cfafb1758f89d5288c22623b5c59276d3be4e21 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 20 Apr 2021 01:29:19 +0200 Subject: [PATCH 22/51] home: i3: default border pixel --- home/x/i3.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index e1cb7ed..919a86b 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -168,6 +168,11 @@ in ]; }; }; + + # FIXME: integrate in config when it doesn't use deprecated new_window + extraConfig = '' + default_border pixel + ''; }; }; } From c71c5d345f831ec9ac8dd3206cb759703627d158 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 20 Apr 2021 01:50:10 +0200 Subject: [PATCH 23/51] home: i3: use barchart for CPU usage --- home/x/i3bar.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix index cf678e2..a6f6bd5 100644 --- a/home/x/i3bar.nix +++ b/home/x/i3bar.nix @@ -33,6 +33,7 @@ in { block = "cpu"; interval = 1; + format = "{barchart}"; } { block = "temperature"; From 93eccb76eccabb19cbfd115371e61beba60bb172 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 21 Apr 2021 01:47:11 +0200 Subject: [PATCH 24/51] home: i3: add memory usage block --- home/x/i3bar.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix index a6f6bd5..bd6028d 100644 --- a/home/x/i3bar.nix +++ b/home/x/i3bar.nix @@ -30,6 +30,17 @@ in warning = 20.0; alert = 10.0; } + # TODO: update to new format when i3status-rust updates to v0.20: + # https://github.com/greshake/i3status-rust/blob/4d55b1d94ee09cbdefd805841fb54a2a4a0663a4/doc/blocks.md#available-format-keys-11 + { + block = "memory"; + display_type = "memory"; + format_mem = "{Mug}/{MTg}GB"; + warning_mem = 70.0; + critical_mem = 90.0; + # don't show swap + clickable = false; + } { block = "cpu"; interval = 1; From 0cdb05ecf1d677ea6b996fa406ea4317685fd9d8 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 21 Apr 2021 02:11:48 +0200 Subject: [PATCH 25/51] home: i3: setup bluetooth mouse battery block --- .gitattributes | 1 + home/default.nix | 1 + home/secrets/bluetooth-mouse-mac-address.secret | Bin 0 -> 40 bytes home/secrets/default.nix | 13 +++++++++++++ home/x/i3bar.nix | 7 +++++++ 5 files changed, 22 insertions(+) create mode 100644 home/secrets/bluetooth-mouse-mac-address.secret create mode 100644 home/secrets/default.nix diff --git a/.gitattributes b/.gitattributes index 0fe79d9..62988e9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ secrets/*.secret filter=git-crypt diff=git-crypt secrets/wireguard.nix filter=git-crypt diff=git-crypt +home/secrets/*.secret filter=git-crypt diff=git-crypt diff --git a/home/default.nix b/home/default.nix index 0da2e12..cc7cb84 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,6 +3,7 @@ imports = [ ./emacs.nix ./flameshot.nix + ./secrets ./tmux.nix ./x ]; diff --git a/home/secrets/bluetooth-mouse-mac-address.secret b/home/secrets/bluetooth-mouse-mac-address.secret new file mode 100644 index 0000000000000000000000000000000000000000..cc6ff3c3207037ddb8d04186e57041211f35b93c GIT binary patch literal 40 xcmZQ@_Y83kiVO&0cvBgc_vCg`^^5Bk6PH Date: Wed, 21 Apr 2021 04:05:19 +0200 Subject: [PATCH 26/51] home: themes: setup theme types for i3 --- home/default.nix | 1 + home/themes/color.nix | 9 ++ home/themes/default.nix | 22 +++++ home/themes/i3.nix | 183 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 215 insertions(+) create mode 100644 home/themes/color.nix create mode 100644 home/themes/default.nix create mode 100644 home/themes/i3.nix diff --git a/home/default.nix b/home/default.nix index cc7cb84..22ffb90 100644 --- a/home/default.nix +++ b/home/default.nix @@ -4,6 +4,7 @@ ./emacs.nix ./flameshot.nix ./secrets + ./themes ./tmux.nix ./x ]; diff --git a/home/themes/color.nix b/home/themes/color.nix new file mode 100644 index 0000000..46ce77e --- /dev/null +++ b/home/themes/color.nix @@ -0,0 +1,9 @@ +{ lib }: +let + mkColorOption = with lib; {default ? "#000000", description ? "" }: mkOption { + inherit description default; + example = "#abcdef"; + type = types.strMatching "#[0-9a-f]{6}"; + }; +in +mkColorOption diff --git a/home/themes/default.nix b/home/themes/default.nix new file mode 100644 index 0000000..2f7e73d --- /dev/null +++ b/home/themes/default.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: +with lib; +let + themeType = types.submodule { + options = { + i3Theme = mkOption { + type = import ./i3.nix { inherit lib; }; + }; + }; + }; +in +{ + options.my.home = { + theme = mkOption { + type = themeType; + }; + + themes = mkOption { + type = with types; attrsOf themeType; + }; + }; +} diff --git a/home/themes/i3.nix b/home/themes/i3.nix new file mode 100644 index 0000000..9e9d72d --- /dev/null +++ b/home/themes/i3.nix @@ -0,0 +1,183 @@ +{ lib }: +with lib; +let + mkColorOption = import ./color.nix { inherit lib; }; + + barColorSetModule = types.submodule { + options = { + border = mkColorOption {}; + background = mkColorOption {}; + text = mkColorOption {}; + }; + }; + + colorSetModule = types.submodule { + options = { + border = mkColorOption {}; + childBorder = mkColorOption {}; + background = mkColorOption {}; + text = mkColorOption {}; + indicator = mkColorOption {}; + }; + }; +in +types.submodule { + options = { + bar = mkOption { + type = types.submodule { + options = { + background = mkColorOption { + default = "#000000"; + description = "Background color of the bar."; + }; + + statusline = mkColorOption { + default = "#ffffff"; + description = "Text color to be used for the statusline."; + }; + + separator = mkColorOption { + default = "#666666"; + description = "Text color to be used for the separator."; + }; + + focusedWorkspace = mkOption { + type = barColorSetModule; + default = { + border = "#4c7899"; + background = "#285577"; + text = "#ffffff"; + }; + description = '' + Border, background and text color for a workspace button when the workspace has focus. + ''; + }; + + activeWorkspace = mkOption { + type = barColorSetModule; + default = { + border = "#333333"; + background = "#5f676a"; + text = "#ffffff"; + }; + description = '' + Border, background and text color for a workspace button when the workspace is active. + ''; + }; + + inactiveWorkspace = mkOption { + type = barColorSetModule; + default = { + border = "#333333"; + background = "#222222"; + text = "#888888"; + }; + description = '' + Border, background and text color for a workspace button when the workspace does not + have focus and is not active. + ''; + }; + + urgentWorkspace = mkOption { + type = barColorSetModule; + default = { + border = "#2f343a"; + background = "#900000"; + text = "#ffffff"; + }; + description = '' + Border, background and text color for a workspace button when the workspace contains + a window with the urgency hint set. + ''; + }; + + bindingMode = mkOption { + type = barColorSetModule; + default = { + border = "#2f343a"; + background = "#900000"; + text = "#ffffff"; + }; + description = + "Border, background and text color for the binding mode indicator"; + }; + }; + }; + }; + + background = mkOption { + type = types.str; + default = "#ffffff"; + description = '' + Background color of the window. Only applications which do not cover + the whole area expose the color. + ''; + }; + + focused = mkOption { + type = colorSetModule; + default = { + border = "#4c7899"; + background = "#285577"; + text = "#ffffff"; + indicator = "#2e9ef4"; + childBorder = "#285577"; + }; + description = "A window which currently has the focus."; + }; + + focusedInactive = mkOption { + type = colorSetModule; + default = { + border = "#333333"; + background = "#5f676a"; + text = "#ffffff"; + indicator = "#484e50"; + childBorder = "#5f676a"; + }; + description = '' + A window which is the focused one of its container, + but it does not have the focus at the moment. + ''; + }; + + unfocused = mkOption { + type = colorSetModule; + default = { + border = "#333333"; + background = "#222222"; + text = "#888888"; + indicator = "#292d2e"; + childBorder = "#222222"; + }; + description = "A window which is not focused."; + }; + + urgent = mkOption { + type = colorSetModule; + default = { + border = "#2f343a"; + background = "#900000"; + text = "#ffffff"; + indicator = "#900000"; + childBorder = "#900000"; + }; + description = "A window which has its urgency hint activated."; + }; + + placeholder = mkOption { + type = colorSetModule; + default = { + border = "#000000"; + background = "#0c0c0c"; + text = "#ffffff"; + indicator = "#000000"; + childBorder = "#0c0c0c"; + }; + description = '' + Background and text color are used to draw placeholder window + contents (when restoring layouts). Border and indicator are ignored. + ''; + }; + }; +} From 7846271ba557b09f3e545ee659ec9240a19c08f7 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 21 Apr 2021 04:06:51 +0200 Subject: [PATCH 27/51] home: themes: setup solarized light --- home/themes/default.nix | 4 ++ home/themes/solarizedLight/colors.nix | 12 +++++ home/themes/solarizedLight/default.nix | 3 ++ home/themes/solarizedLight/i3.nix | 64 ++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 home/themes/solarizedLight/colors.nix create mode 100644 home/themes/solarizedLight/default.nix create mode 100644 home/themes/solarizedLight/i3.nix diff --git a/home/themes/default.nix b/home/themes/default.nix index 2f7e73d..3ea1897 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -19,4 +19,8 @@ in type = with types; attrsOf themeType; }; }; + + config.my.home.themes = { + solarizedLight = import ./solarizedLight; + }; } diff --git a/home/themes/solarizedLight/colors.nix b/home/themes/solarizedLight/colors.nix new file mode 100644 index 0000000..7c7f771 --- /dev/null +++ b/home/themes/solarizedLight/colors.nix @@ -0,0 +1,12 @@ +{ + background = "#282828"; + red = "#cc241d"; + green = "#98971a"; + yellow = "#d79921"; + blue = "#458588"; + purple = "#b16286"; + aqua = "#689d68"; + gray = "#a89984"; + darkGray = "#1d2021"; + white = "#ffffff"; +} diff --git a/home/themes/solarizedLight/default.nix b/home/themes/solarizedLight/default.nix new file mode 100644 index 0000000..f0646f6 --- /dev/null +++ b/home/themes/solarizedLight/default.nix @@ -0,0 +1,3 @@ +{ + i3Theme = import ./i3.nix; +} diff --git a/home/themes/solarizedLight/i3.nix b/home/themes/solarizedLight/i3.nix new file mode 100644 index 0000000..75399b3 --- /dev/null +++ b/home/themes/solarizedLight/i3.nix @@ -0,0 +1,64 @@ +let + colors = import ./colors.nix; +in +with colors; +{ + bar = { + background = background; + statusline = yellow; + separator = red; + + focusedWorkspace = { + border = aqua; + background = aqua; + text = darkGray; + }; + inactiveWorkspace = { + border = darkGray; + background = darkGray; + text = yellow; + }; + activeWorkspace = { + border = aqua; + background = darkGray; + text = yellow; + }; + urgentWorkspace = { + border = red; + background = red; + text = background; + }; + }; + + focused = { + border = blue; + background = blue; + text = darkGray; + indicator = purple; + childBorder = darkGray; + }; + + focusedInactive = { + border = darkGray; + background = darkGray; + text = yellow; + indicator = purple; + childBorder = darkGray; + }; + + unfocused = { + border = darkGray; + background = darkGray; + text = yellow; + indicator = purple; + childBorder = darkGray; + }; + + urgent = { + border = red; + background = red; + text = white; + indicator = red; + childBorder = red; + }; +} From a8d417c7746b1ed93f4b00711492a3ef813ef1c3 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 21 Apr 2021 04:07:18 +0200 Subject: [PATCH 28/51] home: i3: make use of built-in theme module --- home/x/i3.nix | 74 ++++++--------------------------------------------- 1 file changed, 8 insertions(+), 66 deletions(-) diff --git a/home/x/i3.nix b/home/x/i3.nix index 919a86b..ba0c559 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -14,17 +14,7 @@ let logoutMode = "[L]ogout, [S]uspend, [P]oweroff, [R]eboot"; - # colors - colorBg = "#282828"; - colorRed = "#cc241d"; - colorGreen = "#98971a"; - colorYellow = "#d79921"; - colorBlue = "#458588"; - colorPurple = "#b16286"; - colorAqua = "#689d68"; - colorGray = "#a89984"; - colorDarkGray = "#1d2021"; - colorWhite = "#ffffff"; + i3Theme = config.my.home.theme.i3Theme; in { config = lib.mkIf isEnabled { @@ -53,65 +43,17 @@ in position = "top"; fonts = [ "DejaVuSansMono" "FontAwesome5Free 9" ]; - colors = { - background = colorBg; - statusline = colorYellow; - - focusedWorkspace = { - border = colorAqua; - background = colorAqua; - text = colorDarkGray; - }; - inactiveWorkspace = { - border = colorDarkGray; - background = colorDarkGray; - text = colorYellow; - }; - activeWorkspace = { - border = colorAqua; - background = colorDarkGray; - text = colorYellow; - }; - urgentWorkspace = { - border = colorRed; - background = colorRed; - text = colorBg; - }; - - separator = colorRed; - }; + colors = i3Theme.bar; } ]; colors = { - focused = { - border = colorBlue; - background = colorBlue; - text = colorDarkGray; - indicator = colorPurple; - childBorder = colorDarkGray; - }; - focusedInactive = { - border = colorDarkGray; - background = colorDarkGray; - text = colorYellow; - indicator = colorPurple; - childBorder = colorDarkGray; - }; - unfocused = { - border = colorDarkGray; - background = colorDarkGray; - text = colorYellow; - indicator = colorPurple; - childBorder = colorDarkGray; - }; - urgent = { - border = colorRed; - background = colorRed; - text = colorWhite; - indicator = colorRed; - childBorder = colorRed; - }; + inherit (i3Theme) + focused + focusedInactive + unfocused + urgent + ; }; focus = { From a25d5051d3d2a0d12ffdb6182ad1b96fe6b52799 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 21 Apr 2021 04:07:38 +0200 Subject: [PATCH 29/51] boreal: use solarized light theme --- hosts/boreal/home.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index c39bf22..d2290df 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -1,9 +1,10 @@ -{ ... }: +{ config, ... }: { home-manager.users.alarsyo = { # Keyboard settings & i3 settings my.home.x.enable = true; my.home.emacs.enable = true; my.home.tmux.enable = true; + my.home.theme = config.home-manager.users.alarsyo.my.home.themes.solarizedLight; }; } From 6ff469e96f9a46ecb3c6822d4a8035d14776734d Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 21 Apr 2021 10:30:05 +0200 Subject: [PATCH 30/51] home: themes: move options to my.themes --- home/themes/default.nix | 14 ++++++-------- home/x/i3.nix | 2 +- hosts/boreal/home.nix | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/home/themes/default.nix b/home/themes/default.nix index 3ea1897..0ee7404 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -10,17 +10,15 @@ let }; in { - options.my.home = { - theme = mkOption { + options.my.theme = mkOption { type = themeType; - }; - - themes = mkOption { - type = with types; attrsOf themeType; - }; }; - config.my.home.themes = { + options.my.themes = mkOption { + type = with types; attrsOf themeType; + }; + + config.my.themes = { solarizedLight = import ./solarizedLight; }; } diff --git a/home/x/i3.nix b/home/x/i3.nix index ba0c559..8930ea3 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -14,7 +14,7 @@ let logoutMode = "[L]ogout, [S]uspend, [P]oweroff, [R]eboot"; - i3Theme = config.my.home.theme.i3Theme; + i3Theme = config.my.theme.i3Theme; in { config = lib.mkIf isEnabled { diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index d2290df..722eb5f 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -5,6 +5,6 @@ my.home.x.enable = true; my.home.emacs.enable = true; my.home.tmux.enable = true; - my.home.theme = config.home-manager.users.alarsyo.my.home.themes.solarizedLight; + my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight; }; } From 28e08c817ef700768f0795c2767f2a9c78b409b5 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 21 Apr 2021 10:47:01 +0200 Subject: [PATCH 31/51] home: i3: enable workspace auto back&forth --- home/x/i3.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index 8930ea3..6ff8e37 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -114,6 +114,7 @@ in # FIXME: integrate in config when it doesn't use deprecated new_window extraConfig = '' default_border pixel + workspace_auto_back_and_forth yes ''; }; }; From 36d8b273b7e04b9ea2c7e535635cabaf504f8bfc Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 21 Apr 2021 18:53:21 +0200 Subject: [PATCH 32/51] home: setup x cursor module --- home/x/cursor.nix | 17 +++++++++++++++++ home/x/default.nix | 1 + hosts/boreal/home.nix | 1 + 3 files changed, 19 insertions(+) create mode 100644 home/x/cursor.nix diff --git a/home/x/cursor.nix b/home/x/cursor.nix new file mode 100644 index 0000000..0b69d47 --- /dev/null +++ b/home/x/cursor.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.home.x.cursor; +in +{ + options.my.home.x.cursor.enable = lib.mkEnableOption "X cursor"; + + config = lib.mkIf cfg.enable { + xsession.pointerCursor = { + package = pkgs.capitaine-cursors; + name = "capitaine-cursors"; + # available sizes for capitaine-cursors are: + # 24, 30, 36, 48, 60, 72 + size = 30; + }; + }; +} diff --git a/home/x/default.nix b/home/x/default.nix index ca92c09..9473fc3 100644 --- a/home/x/default.nix +++ b/home/x/default.nix @@ -1,6 +1,7 @@ { config, lib, pkgs, ... }: { imports = [ + ./cursor.nix ./i3.nix ./i3bar.nix ]; diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index 722eb5f..623800a 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -3,6 +3,7 @@ home-manager.users.alarsyo = { # Keyboard settings & i3 settings my.home.x.enable = true; + my.home.x.cursor.enable = true; my.home.emacs.enable = true; my.home.tmux.enable = true; my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight; From 0e07f901bce32245ee98a30c987c56264039fc30 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 00:25:39 +0200 Subject: [PATCH 33/51] home: alacritty: setup config --- home/alacritty.nix | 31 +++++++++ home/default.nix | 1 + home/themes/alacritty.nix | 89 ++++++++++++++++++++++++ home/themes/default.nix | 4 ++ home/themes/solarizedLight/alacritty.nix | 39 +++++++++++ home/themes/solarizedLight/colors.nix | 39 ++++++++--- home/themes/solarizedLight/default.nix | 1 + home/themes/solarizedLight/i3.nix | 2 +- hosts/boreal/home.nix | 1 + 9 files changed, 196 insertions(+), 11 deletions(-) create mode 100644 home/alacritty.nix create mode 100644 home/themes/alacritty.nix create mode 100644 home/themes/solarizedLight/alacritty.nix diff --git a/home/alacritty.nix b/home/alacritty.nix new file mode 100644 index 0000000..7ef12a7 --- /dev/null +++ b/home/alacritty.nix @@ -0,0 +1,31 @@ +{ config, lib, ... }: +let + cfg = config.my.home.alacritty; + alacrittyTheme = config.my.theme.alacrittyTheme; +in +{ + options.my.home.alacritty.enable = lib.mkEnableOption "Alacritty terminal"; + + config.programs.alacritty = lib.mkIf cfg.enable { + enable = true; + + settings = { + window = { + padding = { + x = 8; + y = 8; + }; + decorations = "none"; + }; + + font = { + normal = { + family = "Input Mono Narrow"; + }; + size = 9.0; + }; + + colors = alacrittyTheme; + }; + }; +} diff --git a/home/default.nix b/home/default.nix index 22ffb90..64acc10 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./alacritty.nix ./emacs.nix ./flameshot.nix ./secrets diff --git a/home/themes/alacritty.nix b/home/themes/alacritty.nix new file mode 100644 index 0000000..0e1aeb3 --- /dev/null +++ b/home/themes/alacritty.nix @@ -0,0 +1,89 @@ +{ lib }: +with lib; +let + mkColorOption = import ./color.nix { inherit lib; }; + + primaryColorModule = types.submodule { + options = { + background = mkColorOption {}; + foreground = mkColorOption {}; + }; + }; + + cursorColorModule = types.submodule { + options = { + text = mkColorOption {}; + cursor = mkColorOption {}; + }; + }; + + rainbowColorModule = types.submodule { + options = { + black = mkColorOption {}; + red = mkColorOption {}; + green = mkColorOption {}; + yellow = mkColorOption {}; + blue = mkColorOption {}; + magenta = mkColorOption {}; + cyan = mkColorOption {}; + white = mkColorOption {}; + }; + }; +in +types.submodule { + options = { + primary = mkOption { + type = primaryColorModule; + default = { + foreground = "#c5c8c6"; + background = "#1d1f21"; + }; + }; + cursor = mkOption { + type = cursorColorModule; + default = { + text = "#1d1f21"; + cursor = "#c5c8c6"; + }; + }; + normal = mkOption { + type = rainbowColorModule; + default = { + black = "#1d1f21"; + red = "#cc6666"; + green = "#b5bd68"; + yellow = "#f0c674"; + blue = "#81a2be"; + magenta = "#b294bb"; + cyan = "#8abeb7"; + white = "#c5c8c6"; + }; + }; + bright = mkOption { + type = rainbowColorModule; + default = { + black = "#666666"; + red = "#d54e53"; + green = "#b9ca4a"; + yellow = "#e7c547"; + blue = "#7aa6da"; + magenta = "#c397d8"; + cyan = "#70c0b1"; + white = "#eaeaea"; + }; + }; + dim = mkOption { + type = rainbowColorModule; + default = { + black = "#131415"; + red = "#864343"; + green = "#777c44"; + yellow = "#9e824c"; + blue = "#556a7d"; + magenta = "#75617b"; + cyan = "#5b7d78"; + white = "#828482"; + }; + }; + }; +} diff --git a/home/themes/default.nix b/home/themes/default.nix index 0ee7404..9911106 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -3,6 +3,10 @@ with lib; let themeType = types.submodule { options = { + alacrittyTheme = mkOption { + type = import ./alacritty.nix { inherit lib; }; + default = {}; + }; i3Theme = mkOption { type = import ./i3.nix { inherit lib; }; }; diff --git a/home/themes/solarizedLight/alacritty.nix b/home/themes/solarizedLight/alacritty.nix new file mode 100644 index 0000000..9f2149f --- /dev/null +++ b/home/themes/solarizedLight/alacritty.nix @@ -0,0 +1,39 @@ +let + colors = import ./colors.nix; +in +with colors; +{ + primary = { + background = base3; + foreground = base00; + }; + + cursor = { + text = base3; + cursor = base00; + }; + + normal = { + black = base02; + red = red; + green = green; + yellow = yellow; + blue = blue; + magenta = magenta; + cyan = cyan; + white = base2; + }; + + bright = { + black = base03; + red = orange; + green = base01; + yellow = base00; + blue = base0; + magenta = violet; + cyan = base1; + white = base3; + }; + + dim = {}; +} diff --git a/home/themes/solarizedLight/colors.nix b/home/themes/solarizedLight/colors.nix index 7c7f771..e5cac20 100644 --- a/home/themes/solarizedLight/colors.nix +++ b/home/themes/solarizedLight/colors.nix @@ -1,12 +1,31 @@ { - background = "#282828"; - red = "#cc241d"; - green = "#98971a"; - yellow = "#d79921"; - blue = "#458588"; - purple = "#b16286"; - aqua = "#689d68"; - gray = "#a89984"; - darkGray = "#1d2021"; - white = "#ffffff"; + i3 = { + background = "#282828"; + red = "#cc241d"; + green = "#98971a"; + yellow = "#d79921"; + blue = "#458588"; + purple = "#b16286"; + aqua = "#689d68"; + gray = "#a89984"; + darkGray = "#1d2021"; + white = "#ffffff"; + }; + + base03 = "#002b36"; # brblack + base02 = "#073642"; # black + base01 = "#586e75"; # brgreen + base00 = "#657b83"; # bryellow + base0 = "#839496"; # brblue + base1 = "#93a1a1"; # brcyan + base2 = "#eee8d5"; # white + base3 = "#fdf6e3"; # brwhite + yellow = "#b58900"; # yellow + orange = "#cb4b16"; # brred + red = "#dc322f"; # red + magenta = "#d33682"; # magenta + violet = "#6c71c4"; # brmagenta + blue = "#268bd2"; # blue + cyan = "#2aa198"; # cyan + green = "#859900"; # green } diff --git a/home/themes/solarizedLight/default.nix b/home/themes/solarizedLight/default.nix index f0646f6..299fec1 100644 --- a/home/themes/solarizedLight/default.nix +++ b/home/themes/solarizedLight/default.nix @@ -1,3 +1,4 @@ { i3Theme = import ./i3.nix; + alacrittyTheme = import ./alacritty.nix; } diff --git a/home/themes/solarizedLight/i3.nix b/home/themes/solarizedLight/i3.nix index 75399b3..69a9982 100644 --- a/home/themes/solarizedLight/i3.nix +++ b/home/themes/solarizedLight/i3.nix @@ -1,7 +1,7 @@ let colors = import ./colors.nix; in -with colors; +with colors.i3; { bar = { background = background; diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index 623800a..b178f61 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -4,6 +4,7 @@ # Keyboard settings & i3 settings my.home.x.enable = true; my.home.x.cursor.enable = true; + my.home.alacritty.enable = true; my.home.emacs.enable = true; my.home.tmux.enable = true; my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight; From 08beb20033ff37d2498f380b03ef1132483f79a1 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 00:25:49 +0200 Subject: [PATCH 34/51] home: themes: set default values --- home/themes/default.nix | 2 ++ home/themes/i3.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/home/themes/default.nix b/home/themes/default.nix index 9911106..ebf417e 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -9,6 +9,7 @@ let }; i3Theme = mkOption { type = import ./i3.nix { inherit lib; }; + default = {}; }; }; }; @@ -16,6 +17,7 @@ in { options.my.theme = mkOption { type = themeType; + default = {}; }; options.my.themes = mkOption { diff --git a/home/themes/i3.nix b/home/themes/i3.nix index 9e9d72d..450f26a 100644 --- a/home/themes/i3.nix +++ b/home/themes/i3.nix @@ -103,6 +103,8 @@ types.submodule { }; }; }; + + default = {}; }; background = mkOption { From 845b1c5c4e33621de0c0a155567a9d0dbead9400 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 00:27:34 +0200 Subject: [PATCH 35/51] home: tmux: set terminal to screen-256color --- home/tmux.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/tmux.nix b/home/tmux.nix index 8325fa9..b19036a 100644 --- a/home/tmux.nix +++ b/home/tmux.nix @@ -10,5 +10,6 @@ in config.programs.tmux = lib.mkIf cfg.enable { enable = true; baseIndex = 1; + terminal = "screen-256color"; }; } From fb1b440a41c1d98003a85929c27161f631f80cd4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 00:47:33 +0200 Subject: [PATCH 36/51] home: alacritty: don't hide borders --- home/alacritty.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/home/alacritty.nix b/home/alacritty.nix index 7ef12a7..5232b82 100644 --- a/home/alacritty.nix +++ b/home/alacritty.nix @@ -15,7 +15,6 @@ in x = 8; y = 8; }; - decorations = "none"; }; font = { From acb4607a04d3ca0621378a05b6ab89e07a79c480 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 01:23:00 +0200 Subject: [PATCH 37/51] home: theme: switch to real solarized for i3 --- home/themes/solarizedLight/colors.nix | 13 ------ home/themes/solarizedLight/i3.nix | 58 +++++++++++++-------------- 2 files changed, 29 insertions(+), 42 deletions(-) diff --git a/home/themes/solarizedLight/colors.nix b/home/themes/solarizedLight/colors.nix index e5cac20..f4c69b7 100644 --- a/home/themes/solarizedLight/colors.nix +++ b/home/themes/solarizedLight/colors.nix @@ -1,17 +1,4 @@ { - i3 = { - background = "#282828"; - red = "#cc241d"; - green = "#98971a"; - yellow = "#d79921"; - blue = "#458588"; - purple = "#b16286"; - aqua = "#689d68"; - gray = "#a89984"; - darkGray = "#1d2021"; - white = "#ffffff"; - }; - base03 = "#002b36"; # brblack base02 = "#073642"; # black base01 = "#586e75"; # brgreen diff --git a/home/themes/solarizedLight/i3.nix b/home/themes/solarizedLight/i3.nix index 69a9982..3eab85d 100644 --- a/home/themes/solarizedLight/i3.nix +++ b/home/themes/solarizedLight/i3.nix @@ -1,64 +1,64 @@ let colors = import ./colors.nix; in -with colors.i3; +with colors; { bar = { - background = background; + background = base3; statusline = yellow; separator = red; focusedWorkspace = { - border = aqua; - background = aqua; - text = darkGray; + border = blue; + background = blue; + text = base3; # base2 ? }; inactiveWorkspace = { - border = darkGray; - background = darkGray; - text = yellow; + border = base2; + background = base2; + text = base00; }; activeWorkspace = { - border = aqua; - background = darkGray; + border = blue; + background = base2; text = yellow; }; urgentWorkspace = { border = red; background = red; - text = background; + text = base3; }; }; focused = { border = blue; background = blue; - text = darkGray; - indicator = purple; - childBorder = darkGray; + text = base3; + indicator = magenta; + childBorder = blue; }; focusedInactive = { - border = darkGray; - background = darkGray; - text = yellow; - indicator = purple; - childBorder = darkGray; + border = base2; + background = base2; + text = base00; + indicator = magenta; + childBorder = base2; }; unfocused = { - border = darkGray; - background = darkGray; - text = yellow; - indicator = purple; - childBorder = darkGray; + border = base2; + background = base2; + text = base00; + indicator = magenta; + childBorder = base2; }; urgent = { - border = red; - background = red; - text = white; - indicator = red; - childBorder = red; + border = orange; + background = orange; + text = base3; + indicator = magenta; + childBorder = orange; }; } From c43917a9797dd5f669dfa754d943c0d1a450d77b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 01:25:08 +0200 Subject: [PATCH 38/51] home: i3: remove border setting --- home/x/i3.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/home/x/i3.nix b/home/x/i3.nix index 6ff8e37..33a9166 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -111,9 +111,7 @@ in }; }; - # FIXME: integrate in config when it doesn't use deprecated new_window extraConfig = '' - default_border pixel workspace_auto_back_and_forth yes ''; }; From 494542899d753066cf451641ee84535b51cd92d8 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 01:25:37 +0200 Subject: [PATCH 39/51] home: i3: use option for ws back&forth --- home/x/i3.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/home/x/i3.nix b/home/x/i3.nix index 33a9166..c5f40ec 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -61,6 +61,8 @@ in mouseWarping = true; }; + workspaceAutoBackAndForth = true; + fonts = [ "DejaVu Sans Mono 8" ]; @@ -110,10 +112,6 @@ in ]; }; }; - - extraConfig = '' - workspace_auto_back_and_forth yes - ''; }; }; } From 273cbba17fd154c00b7416a5f2dee5083df87b92 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 02:33:39 +0200 Subject: [PATCH 40/51] home: themes: setup i3bar theme --- home/themes/default.nix | 4 ++++ home/themes/i3bar.nix | 24 ++++++++++++++++++++++++ home/themes/solarizedLight/default.nix | 1 + home/themes/solarizedLight/i3bar.nix | 21 +++++++++++++++++++++ home/x/i3bar.nix | 4 +++- 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 home/themes/i3bar.nix create mode 100644 home/themes/solarizedLight/i3bar.nix diff --git a/home/themes/default.nix b/home/themes/default.nix index ebf417e..6ce1d1a 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -11,6 +11,10 @@ let type = import ./i3.nix { inherit lib; }; default = {}; }; + i3BarTheme = mkOption { + type = import ./i3bar.nix { inherit lib; }; + default = {}; + }; }; }; in diff --git a/home/themes/i3bar.nix b/home/themes/i3bar.nix new file mode 100644 index 0000000..990c6d5 --- /dev/null +++ b/home/themes/i3bar.nix @@ -0,0 +1,24 @@ +{ lib }: +with lib; +let + mkColorOption = import ./color.nix { inherit lib; }; +in +types.submodule { + options = { + theme = mkOption { + type = types.submodule { + options = { + name = mkOption { + type = types.str; + default = "plain"; + }; + overrides = mkOption { + type = types.attrsOf types.str; + default = {}; + }; + }; + }; + default = {}; + }; + }; +} diff --git a/home/themes/solarizedLight/default.nix b/home/themes/solarizedLight/default.nix index 299fec1..ed22ad4 100644 --- a/home/themes/solarizedLight/default.nix +++ b/home/themes/solarizedLight/default.nix @@ -1,4 +1,5 @@ { i3Theme = import ./i3.nix; + i3BarTheme = import ./i3bar.nix; alacrittyTheme = import ./alacritty.nix; } diff --git a/home/themes/solarizedLight/i3bar.nix b/home/themes/solarizedLight/i3bar.nix new file mode 100644 index 0000000..69594f4 --- /dev/null +++ b/home/themes/solarizedLight/i3bar.nix @@ -0,0 +1,21 @@ +let + colors = import ./colors.nix; +in +with colors; +{ + theme = { + name = "solarized-light"; + overrides = { + idle_bg = base2; + idle_fg = base00; + info_bg = blue; + info_fg = base3; + good_bg = green; + good_fg = base3; + warning_bg = yellow; + warning_fg = base3; + critical_bg = red; + critical_fg = base3; + }; + }; +} diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix index 4ebc301..a9c4b65 100644 --- a/home/x/i3bar.nix +++ b/home/x/i3bar.nix @@ -1,6 +1,7 @@ { config, lib, pkgs, ... }: let isEnabled = config.my.home.x.enable; + i3BarTheme = config.my.theme.i3BarTheme; in { @@ -16,8 +17,9 @@ in bars = { top = { - theme = "solarized-light"; icons = "awesome5"; + theme = i3BarTheme.theme.name; + settings = i3BarTheme; blocks = [ { From 7de95e8626d65c338a8ec652942e250873f50871 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 03:12:42 +0200 Subject: [PATCH 41/51] flake.lock: Update Flake input changes: * Updated 'emacs-overlay': 'github:nix-community/emacs-overlay/905883cd5de24958bfd354c6e335f38f667e7ede' -> 'github:nix-community/emacs-overlay/e4778461070fb17602e71b01b8beaf7976e5f6ca' * Updated 'nixpkgs-unstable': 'github:NixOS/nixpkgs/a73020b2a150322c9832b50baeb0296ba3b13dd7' -> 'github:NixOS/nixpkgs/0a5f5bab0e08e968ef25cff393312aa51a3512cf' --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 2677d02..966182b 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "emacs-overlay": { "locked": { - "lastModified": 1618653777, - "narHash": "sha256-jSG1i83pmKwAx6QtkVjyCQT+/LvMEMEVeVDZcOFjRTg=", + "lastModified": 1619028898, + "narHash": "sha256-OgKYwyxZA7zfdanc8RhfZ7OCHlAXHuzN6r4Q6Gjpzlk=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "905883cd5de24958bfd354c6e335f38f667e7ede", + "rev": "e4778461070fb17602e71b01b8beaf7976e5f6ca", "type": "github" }, "original": { @@ -55,11 +55,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1618072958, - "narHash": "sha256-QDKj58ECixtb4EJMWV5D5Lb2xdCgab1Opi4zjQWbDOg=", + "lastModified": 1618801528, + "narHash": "sha256-1ru9LzP33ElEAZcDzYLgJQG3/uHhAg0LFJEfVZSOPZg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a73020b2a150322c9832b50baeb0296ba3b13dd7", + "rev": "0a5f5bab0e08e968ef25cff393312aa51a3512cf", "type": "github" }, "original": { From 6a984ead58fdc0c71f0eeac9175750e35d3bc2e0 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 03:24:27 +0200 Subject: [PATCH 42/51] home: i3: assign Discord to workspace 10 as well --- home/x/i3.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index c5f40ec..8fee9c0 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -109,6 +109,7 @@ in assigns = { "10" = [ { class = "Slack"; } + { class = "discord"; } ]; }; }; From ecb72c6900729419a65f0a24181a053475529fca Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 03:32:36 +0200 Subject: [PATCH 43/51] boreal: prefer sddm to gdm --- hosts/boreal/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/boreal/default.nix b/hosts/boreal/default.nix index bd66dcb..18759a6 100644 --- a/hosts/boreal/default.nix +++ b/hosts/boreal/default.nix @@ -67,6 +67,7 @@ in xserver = { enable = true; videoDrivers = [ "nvidia" ]; + displayManager.sddm.enable = true; windowManager.i3.enable = true; layout = "fr"; xkbVariant = "us"; From b1e1b0f1dd20cc77d10c6cfee4d683d116e168a7 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 14:22:55 +0200 Subject: [PATCH 44/51] boreal: setup sddm theme module --- boreal.nix | 4 +++- flake.nix | 4 ++++ hosts/boreal/default.nix | 3 ++- modules/default.nix | 6 ++++++ modules/sddm.nix | 23 +++++++++++++++++++++++ pkgs/default.nix | 4 ++++ pkgs/sddm-sugar-candy.nix | 18 ++++++++++++++++++ 7 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 modules/default.nix create mode 100644 modules/sddm.nix create mode 100644 pkgs/default.nix create mode 100644 pkgs/sddm-sugar-candy.nix diff --git a/boreal.nix b/boreal.nix index 174e1d9..498c76a 100644 --- a/boreal.nix +++ b/boreal.nix @@ -1,11 +1,13 @@ { ... }: - { imports = [ # Default configuration ./base ./base/gui-programs.nix + # Module definitions + ./modules + # Service definitions ./services diff --git a/flake.nix b/flake.nix index c7f0e9f..d97a6ac 100644 --- a/flake.nix +++ b/flake.nix @@ -74,6 +74,10 @@ nixpkgs.overlays = [ emacs-overlay.overlay + (self: super: { + packages = import ./pkgs { pkgs = super; }; + }) + # uncomment this to build everything from scratch, fun but takes a # while # diff --git a/hosts/boreal/default.nix b/hosts/boreal/default.nix index 18759a6..2c6783b 100644 --- a/hosts/boreal/default.nix +++ b/hosts/boreal/default.nix @@ -67,12 +67,13 @@ in xserver = { enable = true; videoDrivers = [ "nvidia" ]; - displayManager.sddm.enable = true; windowManager.i3.enable = true; layout = "fr"; xkbVariant = "us"; }; }; + my.displayManager.sddm.enable = true; + sound.enable = true; hardware.pulseaudio = { diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..0b7755f --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./sddm.nix + ]; +} diff --git a/modules/sddm.nix b/modules/sddm.nix new file mode 100644 index 0000000..785a681 --- /dev/null +++ b/modules/sddm.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.displayManager.sddm; +in +{ + options.my.displayManager.sddm.enable = lib.mkEnableOption "SDDM setup"; + + config = lib.mkIf cfg.enable { + services.xserver.displayManager.sddm = { + enable = true; + theme = "sugar-candy"; + }; + + environment.systemPackages = with pkgs; [ + packages.sddm-sugar-candy + + # dependencies for sugar-candy theme + libsForQt5.qt5.qtgraphicaleffects + libsForQt5.qt5.qtquickcontrols2 + libsForQt5.qt5.qtsvg + ]; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..fc0d931 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,4 @@ +{ pkgs }: +{ + sddm-sugar-candy = pkgs.callPackage ./sddm-sugar-candy.nix {}; +} diff --git a/pkgs/sddm-sugar-candy.nix b/pkgs/sddm-sugar-candy.nix new file mode 100644 index 0000000..d446428 --- /dev/null +++ b/pkgs/sddm-sugar-candy.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchFromGitLab }: +stdenv.mkDerivation rec { + pname = "sddm-sugar-candy"; + # latest master commit, no recent tags :( + version = "2b72ef6c6f720fe0ffde5ea5c7c48152e02f6c4f"; + dontBuild = true; + installPhase = '' + mkdir -p $out/share/sddm/themes + cp -aR $src $out/share/sddm/themes/sugar-candy + ''; + src = fetchFromGitLab { + domain = "framagit.org"; + owner = "MarianArlt"; + repo = "sddm-sugar-candy"; + rev = version; + sha256 = "sha256-XggFVsEXLYklrfy1ElkIp9fkTw4wvXbyVkaVCZq4ZLU="; + }; +} From 4b5c301e462b75b8fa07730e8fa9c89be553e30a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 15:15:34 +0200 Subject: [PATCH 45/51] sddm-sugar-candy: use custom config --- pkgs/default.nix | 2 +- pkgs/sddm-sugar-candy/custom-conf.patch | 51 +++++++++++++++++++ .../default.nix} | 7 +-- 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 pkgs/sddm-sugar-candy/custom-conf.patch rename pkgs/{sddm-sugar-candy.nix => sddm-sugar-candy/default.nix} (77%) diff --git a/pkgs/default.nix b/pkgs/default.nix index fc0d931..4b0dc52 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,4 @@ { pkgs }: { - sddm-sugar-candy = pkgs.callPackage ./sddm-sugar-candy.nix {}; + sddm-sugar-candy = pkgs.callPackage ./sddm-sugar-candy {}; } diff --git a/pkgs/sddm-sugar-candy/custom-conf.patch b/pkgs/sddm-sugar-candy/custom-conf.patch new file mode 100644 index 0000000..57bd6e2 --- /dev/null +++ b/pkgs/sddm-sugar-candy/custom-conf.patch @@ -0,0 +1,51 @@ +diff --git a/theme.conf b/theme.conf +index f39fb68..8f3256d 100644 +--- a/theme.conf ++++ b/theme.conf +@@ -1,6 +1,6 @@ + [General] + +-Background="Backgrounds/Mountain.jpg" ++Background="Backgrounds/Colorful Dune.jpg" + ## Path relative to the theme root directory. Most standard image file formats are allowed including support for transparency. (e.g. background.jpeg/illustration.GIF/Foto.png/undraw.svgz) + + DimBackgroundImage="0.0" +@@ -9,8 +9,8 @@ DimBackgroundImage="0.0" + ScaleImageCropped="true" + ## Whether the image should be cropped when scaled proportionally. Setting this to false will fit the whole image instead, possibly leaving white space. This can be exploited beautifully with illustrations (try it with "undraw.svg" included in the theme). + +-ScreenWidth="1440" +-ScreenHeight="900" ++ScreenWidth="1920" ++ScreenHeight="1080" + ## Adjust to your resolution to help SDDM speed up on calculations + + +@@ -44,7 +44,7 @@ MainColor="white" + ## Used for all elements when not focused/hovered etc. Usually the best effect is achieved by having this be either white or a very dark grey like #444 (not black for smoother antialias) + ## Colors can be HEX or Qt names (e.g. red/salmon/blanchedalmond). See https://doc.qt.io/qt-5/qml-color.html + +-AccentColor="#fb884f" ++AccentColor="#268bd2" + ## Used for elements in focus/hover/pressed. Should be contrasting to the background and the MainColor to achieve the best effect. + + BackgroundColor="#444" +@@ -84,7 +84,7 @@ ForceLastUser="true" + ForcePasswordFocus="true" + ## Give automatic focus to the password field. Together with ForceLastUser this makes for the fastest login experience. + +-ForceHideCompletePassword="false" ++ForceHideCompletePassword="true" + ## If you don't like to see any character at all not even while being entered set this to true. + + ForceHideVirtualKeyboardButton="false" +@@ -96,7 +96,8 @@ ForceHideSystemButtons="false" + AllowEmptyPassword="false" + ## Enable login for users without a password. This is discouraged. Makes the login button always enabled. + +-AllowBadUsernames="false" ++## set to true to not capitalize my username ++AllowBadUsernames="true" + ## Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard! Also shows username as is instead of capitalized. + + diff --git a/pkgs/sddm-sugar-candy.nix b/pkgs/sddm-sugar-candy/default.nix similarity index 77% rename from pkgs/sddm-sugar-candy.nix rename to pkgs/sddm-sugar-candy/default.nix index d446428..e42d3c2 100644 --- a/pkgs/sddm-sugar-candy.nix +++ b/pkgs/sddm-sugar-candy/default.nix @@ -5,9 +5,10 @@ stdenv.mkDerivation rec { version = "2b72ef6c6f720fe0ffde5ea5c7c48152e02f6c4f"; dontBuild = true; installPhase = '' - mkdir -p $out/share/sddm/themes - cp -aR $src $out/share/sddm/themes/sugar-candy - ''; + mkdir -p $out/share/sddm/themes + cp -aR . $out/share/sddm/themes/sugar-candy + ''; + patches = [ ./custom-conf.patch ]; src = fetchFromGitLab { domain = "framagit.org"; owner = "MarianArlt"; From e596dee8eea195a1a4a44e4397ff8ce85ef79844 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 16:08:11 +0200 Subject: [PATCH 46/51] home: i3: remove borders for alacritty windows --- home/x/i3.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home/x/i3.nix b/home/x/i3.nix index 8fee9c0..cc7e231 100644 --- a/home/x/i3.nix +++ b/home/x/i3.nix @@ -112,6 +112,10 @@ in { class = "discord"; } ]; }; + + window.commands = [ + { command = "border pixel 2"; criteria = { class = "Alacritty"; }; } + ]; }; }; }; From b538eec36ff53745ab31f0eff698842d2110cfcf Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 16:21:30 +0200 Subject: [PATCH 47/51] home: setup fish and starship module --- home/default.nix | 2 ++ home/fish.nix | 11 +++++++++++ home/starship.nix | 17 +++++++++++++++++ hosts/boreal/home.nix | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 home/fish.nix create mode 100644 home/starship.nix diff --git a/home/default.nix b/home/default.nix index 64acc10..b7917ef 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,8 +3,10 @@ imports = [ ./alacritty.nix ./emacs.nix + ./fish.nix ./flameshot.nix ./secrets + ./starship.nix ./themes ./tmux.nix ./x diff --git a/home/fish.nix b/home/fish.nix new file mode 100644 index 0000000..f16c1fa --- /dev/null +++ b/home/fish.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: +let + cfg = config.my.home.fish; +in +{ + options.my.home.fish.enable = lib.mkEnableOption "Fish shell"; + + config = lib.mkIf cfg.enable { + programs.fish.enable = true; + }; +} diff --git a/home/starship.nix b/home/starship.nix new file mode 100644 index 0000000..8476c85 --- /dev/null +++ b/home/starship.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: +let + cfg = config.my.home.starship; +in +{ + options.my.home.starship.enable = lib.mkEnableOption "Starship.rs prompt"; + + config = lib.mkIf cfg.enable { + programs.starship = { + enable = true; + enableFishIntegration = true; + settings = { + add_newline = false; + }; + }; + }; +} diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index b178f61..cd94d72 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -7,6 +7,9 @@ my.home.alacritty.enable = true; my.home.emacs.enable = true; my.home.tmux.enable = true; + my.home.starship.enable = false; + my.home.fish.enable = true; + my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight; }; } From ee7f2eb7bd34df1a7ab85b63cab9f2ec9a164c97 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 16:52:10 +0200 Subject: [PATCH 48/51] home: switch font to Iosevka for emacs/term --- home/alacritty.nix | 39 ++++++++++++++++++++++++--------------- home/emacs.nix | 2 +- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/home/alacritty.nix b/home/alacritty.nix index 5232b82..577140e 100644 --- a/home/alacritty.nix +++ b/home/alacritty.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.my.home.alacritty; alacrittyTheme = config.my.theme.alacrittyTheme; @@ -6,25 +6,34 @@ in { options.my.home.alacritty.enable = lib.mkEnableOption "Alacritty terminal"; - config.programs.alacritty = lib.mkIf cfg.enable { - enable = true; + config = lib.mkIf cfg.enable { + programs.alacritty = { + enable = true; - settings = { - window = { - padding = { - x = 8; - y = 8; + settings = { + window = { + padding = { + x = 8; + y = 8; + }; }; - }; - font = { - normal = { - family = "Input Mono Narrow"; + font = { + normal = { + family = "Iosevka Fixed"; + style = "Medium"; + }; + size = 10.0; }; - size = 9.0; - }; - colors = alacrittyTheme; + colors = alacrittyTheme; + }; }; + + home.packages = with pkgs; [ + iosevka-bin + ]; + # make sure font is discoverable + fonts.fontconfig.enable = true; }; } diff --git a/home/emacs.nix b/home/emacs.nix index 5b1808e..34d4dab 100644 --- a/home/emacs.nix +++ b/home/emacs.nix @@ -9,8 +9,8 @@ sqlite # needed by org-roam # fonts used by my config - input-fonts emacs-all-the-icons-fonts + iosevka-bin ]; # make sure above fonts are discoverable fonts.fontconfig.enable = true; From dbe1afbfcdfb349d0bd1f16908f571bb76ad20c4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 17:37:34 +0200 Subject: [PATCH 49/51] home: fish: setup wrapper around flake lock --- home/fish.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/home/fish.nix b/home/fish.nix index f16c1fa..d31d7f4 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -6,6 +6,20 @@ in options.my.home.fish.enable = lib.mkEnableOption "Fish shell"; config = lib.mkIf cfg.enable { - programs.fish.enable = true; + programs.fish = { + enable = true; + functions = { + nfl = { + body = '' + set -l flags "--commit-lock-file" + for flake in $argv + set -a flags "--update-input" "$flake" + end + nix flake lock $flags + ''; + description = "convenience wrapper around `nix flake lock` to only update certain flake inputs"; + }; + }; + }; }; } From 325d3ee1b29591902657fdc5e955c34bf0d858a3 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 17:31:20 +0200 Subject: [PATCH 50/51] flake.lock: Update Flake input changes: * Updated 'home-manager': 'github:nix-community/home-manager/6aa6556bcab6dc0f6398b4daa8404d788fd7a6a2' -> 'github:nix-community/home-manager/db00b39a9abec04245486a01b236b8d9734c9ad0' * Updated 'nixpkgs-unstable': 'github:NixOS/nixpkgs/0a5f5bab0e08e968ef25cff393312aa51a3512cf' -> 'github:NixOS/nixpkgs/d235056d6d6dcbd2999bd55fd120d831d4df6304' --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 966182b..517df23 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ ] }, "locked": { - "lastModified": 1618789951, - "narHash": "sha256-EoQxcVIiaqjUwwTl1YF3zGnXtzEvOUDL3SBZ8ASELvU=", + "lastModified": 1618962339, + "narHash": "sha256-Ecud4mXuA96NTCDUWGp5GVVNarZFWZL3YUZ0I8mQKIs=", "owner": "nix-community", "repo": "home-manager", - "rev": "6aa6556bcab6dc0f6398b4daa8404d788fd7a6a2", + "rev": "db00b39a9abec04245486a01b236b8d9734c9ad0", "type": "github" }, "original": { @@ -55,11 +55,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1618801528, - "narHash": "sha256-1ru9LzP33ElEAZcDzYLgJQG3/uHhAg0LFJEfVZSOPZg=", + "lastModified": 1619057301, + "narHash": "sha256-1Y1nCnwGSQHM76KGIhz+8tOAGOT3wlP+dKjwoyQXCtg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0a5f5bab0e08e968ef25cff393312aa51a3512cf", + "rev": "d235056d6d6dcbd2999bd55fd120d831d4df6304", "type": "github" }, "original": { From df15e6b6c25cc835c343454a4a4ef44816af5a6f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 22 Apr 2021 17:52:39 +0200 Subject: [PATCH 51/51] home: fish: use real .fish files for functions --- home/default.nix | 2 +- home/fish.nix | 25 ------------------------- home/fish/default.nix | 15 +++++++++++++++ home/fish/functions/nfl.fish | 7 +++++++ 4 files changed, 23 insertions(+), 26 deletions(-) delete mode 100644 home/fish.nix create mode 100644 home/fish/default.nix create mode 100644 home/fish/functions/nfl.fish diff --git a/home/default.nix b/home/default.nix index b7917ef..3be4117 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,7 +3,7 @@ imports = [ ./alacritty.nix ./emacs.nix - ./fish.nix + ./fish ./flameshot.nix ./secrets ./starship.nix diff --git a/home/fish.nix b/home/fish.nix deleted file mode 100644 index d31d7f4..0000000 --- a/home/fish.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.my.home.fish; -in -{ - options.my.home.fish.enable = lib.mkEnableOption "Fish shell"; - - config = lib.mkIf cfg.enable { - programs.fish = { - enable = true; - functions = { - nfl = { - body = '' - set -l flags "--commit-lock-file" - for flake in $argv - set -a flags "--update-input" "$flake" - end - nix flake lock $flags - ''; - description = "convenience wrapper around `nix flake lock` to only update certain flake inputs"; - }; - }; - }; - }; -} diff --git a/home/fish/default.nix b/home/fish/default.nix new file mode 100644 index 0000000..88104e8 --- /dev/null +++ b/home/fish/default.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: +let + cfg = config.my.home.fish; +in +{ + options.my.home.fish.enable = lib.mkEnableOption "Fish shell"; + + config = lib.mkIf cfg.enable { + programs.fish = { + enable = true; + }; + + xdg.configFile."fish/functions" = { source = ./. + "/functions"; }; + }; +} diff --git a/home/fish/functions/nfl.fish b/home/fish/functions/nfl.fish new file mode 100644 index 0000000..bac1d05 --- /dev/null +++ b/home/fish/functions/nfl.fish @@ -0,0 +1,7 @@ +function nfl + set -l flags "--commit-lock-file" + for flake in $argv + set -a flags "--update-input" "$flake" + end + nix flake lock $flags +end