From 60da6bc47620681b557ea2d105df87b22382efcd Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 12 Feb 2022 13:22:29 -0800 Subject: home-manager: re-organize configuration for myself --- users/common/desktop/browser.nix | 7 ----- users/common/desktop/default.nix | 7 ----- users/fcuny/cli/default.nix | 15 +++++++++++ users/fcuny/cli/git.nix | 40 ++++++++++++++++++++++++++++ users/fcuny/cli/go.nix | 6 +++++ users/fcuny/cli/tmux.nix | 13 +++++++++ users/fcuny/cli/zsh.nix | 21 +++++++++++++++ users/fcuny/default.nix | 21 ++++----------- users/fcuny/desktop.nix | 57 ---------------------------------------- users/fcuny/desktop/browser.nix | 7 +++++ users/fcuny/desktop/default.nix | 20 ++++++++++++++ users/fcuny/desktop/gtk.nix | 36 +++++++++++++++++++++++++ users/fcuny/desktop/i3.nix | 45 +++++++++++++++++++++++++++++++ users/fcuny/desktop/media.nix | 15 +++++++++++ users/fcuny/desktop/pass.nix | 8 ++++++ users/fcuny/desktop/terminal.nix | 21 +++++++++++++++ users/fcuny/desktop/xdg.nix | 18 +++++++++++++ users/fcuny/git.nix | 40 ---------------------------- users/fcuny/go.nix | 6 ----- users/fcuny/i3.nix | 45 ------------------------------- users/fcuny/media.nix | 15 ----------- users/fcuny/pass.nix | 8 ------ users/fcuny/terminal.nix | 21 --------------- users/fcuny/tmux.nix | 13 --------- users/fcuny/zsh.nix | 21 --------------- 25 files changed, 270 insertions(+), 256 deletions(-) delete mode 100644 users/common/desktop/browser.nix delete mode 100644 users/common/desktop/default.nix create mode 100644 users/fcuny/cli/default.nix create mode 100644 users/fcuny/cli/git.nix create mode 100644 users/fcuny/cli/go.nix create mode 100644 users/fcuny/cli/tmux.nix create mode 100644 users/fcuny/cli/zsh.nix delete mode 100644 users/fcuny/desktop.nix create mode 100644 users/fcuny/desktop/browser.nix create mode 100644 users/fcuny/desktop/default.nix create mode 100644 users/fcuny/desktop/gtk.nix create mode 100644 users/fcuny/desktop/i3.nix create mode 100644 users/fcuny/desktop/media.nix create mode 100644 users/fcuny/desktop/pass.nix create mode 100644 users/fcuny/desktop/terminal.nix create mode 100644 users/fcuny/desktop/xdg.nix delete mode 100644 users/fcuny/git.nix delete mode 100644 users/fcuny/go.nix delete mode 100644 users/fcuny/i3.nix delete mode 100644 users/fcuny/media.nix delete mode 100644 users/fcuny/pass.nix delete mode 100644 users/fcuny/terminal.nix delete mode 100644 users/fcuny/tmux.nix delete mode 100644 users/fcuny/zsh.nix (limited to 'users') diff --git a/users/common/desktop/browser.nix b/users/common/desktop/browser.nix deleted file mode 100644 index cbd8d29..0000000 --- a/users/common/desktop/browser.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: - -{ - programs.firefox = { - enable = true; - }; -} diff --git a/users/common/desktop/default.nix b/users/common/desktop/default.nix deleted file mode 100644 index c7ac619..0000000 --- a/users/common/desktop/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - imports = [ - ./browser.nix - ]; -} diff --git a/users/fcuny/cli/default.nix b/users/fcuny/cli/default.nix new file mode 100644 index 0000000..ff2b89f --- /dev/null +++ b/users/fcuny/cli/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ...}: + +{ + imports = [ + ./git.nix + ./go.nix + ./tmux.nix + ./zsh.nix + ]; + + home.packages = [ + pkgs.jq + pkgs.ripgrep + ]; +} diff --git a/users/fcuny/cli/git.nix b/users/fcuny/cli/git.nix new file mode 100644 index 0000000..f7aeb27 --- /dev/null +++ b/users/fcuny/cli/git.nix @@ -0,0 +1,40 @@ +{ + programs.git = { + enable = true; + aliases = { + s = "status --short --branch"; + amend = "commit --amend --no-edit"; + }; + extraConfig = { + core.whitespace = "trailing-space,space-before-tab"; + color.ui = "true"; + push.default = "simple"; + init.defaultBranch = "main"; + branch.autosetuprebase = "remote"; + branch.sort = "authordate"; + }; + userName = "Franck Cuny"; + userEmail = "franck@fcuny.net"; + ignores = [ + "*.elc" + "*.iml" + "*.o" + "*.pyc" + "*.pyo" + "*pyc" + "*~" + ".DS_Store" + ".\\#" + ".dir-locals.el" + ".direnv/*" + ".idea" + ".projectile" + ".pytest_cache/" + "/env/*" + "Icon" + "TAGS" + "\\#*\\#" + "tags" + ]; + }; +} diff --git a/users/fcuny/cli/go.nix b/users/fcuny/cli/go.nix new file mode 100644 index 0000000..990b2ae --- /dev/null +++ b/users/fcuny/cli/go.nix @@ -0,0 +1,6 @@ +{ + programs.go = { + enable = true; + goPath = "workspace/go"; + }; +} diff --git a/users/fcuny/cli/tmux.nix b/users/fcuny/cli/tmux.nix new file mode 100644 index 0000000..1a9a2d4 --- /dev/null +++ b/users/fcuny/cli/tmux.nix @@ -0,0 +1,13 @@ +{ + programs.tmux = { + enable = true; + terminal = "xterm-256color"; + escapeTime = 0; + aggressiveResize = true; + shortcut = "z"; + + extraConfig = '' + setw -g mouse on + ''; + }; +} diff --git a/users/fcuny/cli/zsh.nix b/users/fcuny/cli/zsh.nix new file mode 100644 index 0000000..6b56d35 --- /dev/null +++ b/users/fcuny/cli/zsh.nix @@ -0,0 +1,21 @@ +{config, lib, pkgs, ...}: + +{ + + xdg.configFile."zsh/personal".source = config.lib.file.mkOutOfStoreSymlink ../../configs/zsh; + + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + defaultKeymap = "emacs"; + history = { + save = 100000; + extended = true; + ignoreDups = true; + }; + initExtra = '' + source ${config.xdg.configHome}/zsh/personal/init.zsh + ''; + }; +} diff --git a/users/fcuny/default.nix b/users/fcuny/default.nix index 9d2f194..755f59e 100644 --- a/users/fcuny/default.nix +++ b/users/fcuny/default.nix @@ -1,12 +1,11 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, desktop, ... }: { - programs.home-manager.enable = true; + imports = + [./cli ] + ++ (if desktop then [./desktop] else [ ]); - home.packages = [ - pkgs.jq - pkgs.ripgrep - ]; + programs.home-manager.enable = true; home.sessionVariables = { LANG = "en_US.UTF-8"; @@ -14,14 +13,4 @@ LC_ALL = "en_US.UTF-8"; EDITOR = "vim"; }; - - imports = [ - ../common/desktop - ./git.nix - ./go.nix - ./tmux.nix - ./zsh.nix - ./desktop.nix - ./pass.nix - ]; } diff --git a/users/fcuny/desktop.nix b/users/fcuny/desktop.nix deleted file mode 100644 index b1f4caa..0000000 --- a/users/fcuny/desktop.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - xdg.enable = true; - - xdg.userDirs = { - enable = true; - createDirectories = true; - desktop = "\$HOME/documents"; - documents = "\$HOME/documents"; - download = "\$HOME/downloads"; - music = "\$HOME/media/music"; - pictures = "\$HOME/media/pictures"; - publicShare = "\$HOME/documents/public"; - templates = "\$HOME/documents/templates"; - videos = "\$HOME/media/videos"; - }; - - # This is required for the gtk configuration below - home.packages = [ - pkgs.gnome3.dconf - ]; - - gtk = { - enable = true; - theme.name = "Adwaita"; - iconTheme = { - name = "Adwaita"; - package = pkgs.gnome3.adwaita-icon-theme; - }; - - gtk2 = { - extraConfig = '' - gtk-application-prefer-dark-theme = true - gtk-xft-antialias = 1 - gtk-xft-hinting = 1 - gtk-xft-hintstyle = "hintslight" - gtk-cursor-theme-size = cursorSize - ''; - }; - - gtk3 = { - extraConfig = { - gtk-application-prefer-dark-theme = true; - gtk-xft-antialias = 1; - gtk-xft-hinting = 1; - gtk-xft-hintstyle = "hintslight"; - }; - }; - }; - - imports = [ - ./i3.nix - ./media.nix - ./terminal.nix - ]; -} diff --git a/users/fcuny/desktop/browser.nix b/users/fcuny/desktop/browser.nix new file mode 100644 index 0000000..cbd8d29 --- /dev/null +++ b/users/fcuny/desktop/browser.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + programs.firefox = { + enable = true; + }; +} diff --git a/users/fcuny/desktop/default.nix b/users/fcuny/desktop/default.nix new file mode 100644 index 0000000..9f0bcf3 --- /dev/null +++ b/users/fcuny/desktop/default.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./browser.nix + ./i3.nix + ./media.nix + ./pass.nix + ./terminal.nix + ./gtk.nix + ./xdg.nix + ]; + + home.packages = [ + pkgs.gnome3.eog + pkgs.gnome3.evince + pkgs.gnome3.nautilus + pkgs.transmission-remote-gtk + ]; +} diff --git a/users/fcuny/desktop/gtk.nix b/users/fcuny/desktop/gtk.nix new file mode 100644 index 0000000..492c331 --- /dev/null +++ b/users/fcuny/desktop/gtk.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, ... }: + +{ + # This is required for the gtk configuration below + home.packages = [ + pkgs.gnome3.dconf + ]; + + gtk = { + enable = true; + theme.name = "Adwaita"; + iconTheme = { + name = "Adwaita"; + package = pkgs.gnome3.adwaita-icon-theme; + }; + + gtk2 = { + extraConfig = '' + gtk-application-prefer-dark-theme = true + gtk-xft-antialias = 1 + gtk-xft-hinting = 1 + gtk-xft-hintstyle = "hintslight" + gtk-cursor-theme-size = cursorSize + ''; + }; + + gtk3 = { + extraConfig = { + gtk-application-prefer-dark-theme = true; + gtk-xft-antialias = 1; + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintslight"; + }; + }; + }; +} diff --git a/users/fcuny/desktop/i3.nix b/users/fcuny/desktop/i3.nix new file mode 100644 index 0000000..dd01348 --- /dev/null +++ b/users/fcuny/desktop/i3.nix @@ -0,0 +1,45 @@ +{ config, pkgs, lib, hostname, ... }: +let + mod = "Mod4"; +in +{ + xsession.enable = true; + + xsession.windowManager.i3 = { + enable = true; + config = { + modifier = mod; + terminal = "${pkgs.alacritty}/bin/alacritty"; + window = { + titlebar = false; + border = 2; + }; + keybindings = lib.mkOptionDefault { + "${mod}+r" = "exec --no-startup-id ${pkgs.rofi}/bin/rofi -show drun"; + "${mod}+l" = "exec ${pkgs.systemd}/bin/loginctl lock-session"; + }; + bars = [ ]; + }; + }; + + programs.rofi = { + enable = true; + theme = "purple"; + terminal = "${pkgs.alacritty}/bin/alacritty"; + extraConfig = { + modi = "drun"; + show-icons = true; + combi-modi = "window,drun,ssh"; + }; + }; + + xdg.configFile."polybar/aptos.ini".source = ../../configs/polybar/aptos.ini; + xdg.configFile."polybar/carmel.ini".source = ../../configs/polybar/carmel.ini; + xdg.configFile."polybar/modules".source = ../../configs/polybar/modules; + + services.polybar = { + enable = true; + package = pkgs.polybarFull; + script = "polybar --config=${config.xdg.configHome}/polybar/${hostname}.ini -r alone &"; + }; +} diff --git a/users/fcuny/desktop/media.nix b/users/fcuny/desktop/media.nix new file mode 100644 index 0000000..57d0dd2 --- /dev/null +++ b/users/fcuny/desktop/media.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +{ + home.packages = [ + pkgs.mpd + pkgs.ncmpcpp + ]; + + xdg.configFile."mpd/mpd.conf".source = ../../configs/mpd/mpd.conf; + xdg.configFile."ncmpcpp/config".source = ../../configs/ncmpcpp/config; + + services.mpd = { + enable = true; + }; +} diff --git a/users/fcuny/desktop/pass.nix b/users/fcuny/desktop/pass.nix new file mode 100644 index 0000000..d430ec8 --- /dev/null +++ b/users/fcuny/desktop/pass.nix @@ -0,0 +1,8 @@ +{ pkgs, config, ... }: + +{ + programs.password-store.enable = true; + + programs.password-store.settings.PASSWORD_STORE_DIR = + "${config.xdg.dataHome}/password-store"; +} diff --git a/users/fcuny/desktop/terminal.nix b/users/fcuny/desktop/terminal.nix new file mode 100644 index 0000000..ca3b2e8 --- /dev/null +++ b/users/fcuny/desktop/terminal.nix @@ -0,0 +1,21 @@ +{ config, pkgs, lib, ...}: + +{ + programs.alacritty = { + enable = true; + + settings = { + env = { + TERM = "xterm-256color"; + WINIT_X11_SCALE_FACTOR = "1.2"; + }; + draw_bold_text_with_bright_colors = true; + selection = { + save_to_clipboard = true; + }; + font = { + size = 12; + }; + }; + }; +} diff --git a/users/fcuny/desktop/xdg.nix b/users/fcuny/desktop/xdg.nix new file mode 100644 index 0000000..7390811 --- /dev/null +++ b/users/fcuny/desktop/xdg.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + xdg.enable = true; + + xdg.userDirs = { + enable = true; + createDirectories = true; + desktop = "\$HOME/documents"; + documents = "\$HOME/documents"; + download = "\$HOME/downloads"; + music = "\$HOME/media/music"; + pictures = "\$HOME/media/pictures"; + publicShare = "\$HOME/documents/public"; + templates = "\$HOME/documents/templates"; + videos = "\$HOME/media/videos"; + }; +} diff --git a/users/fcuny/git.nix b/users/fcuny/git.nix deleted file mode 100644 index f7aeb27..0000000 --- a/users/fcuny/git.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - programs.git = { - enable = true; - aliases = { - s = "status --short --branch"; - amend = "commit --amend --no-edit"; - }; - extraConfig = { - core.whitespace = "trailing-space,space-before-tab"; - color.ui = "true"; - push.default = "simple"; - init.defaultBranch = "main"; - branch.autosetuprebase = "remote"; - branch.sort = "authordate"; - }; - userName = "Franck Cuny"; - userEmail = "franck@fcuny.net"; - ignores = [ - "*.elc" - "*.iml" - "*.o" - "*.pyc" - "*.pyo" - "*pyc" - "*~" - ".DS_Store" - ".\\#" - ".dir-locals.el" - ".direnv/*" - ".idea" - ".projectile" - ".pytest_cache/" - "/env/*" - "Icon" - "TAGS" - "\\#*\\#" - "tags" - ]; - }; -} diff --git a/users/fcuny/go.nix b/users/fcuny/go.nix deleted file mode 100644 index 990b2ae..0000000 --- a/users/fcuny/go.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.go = { - enable = true; - goPath = "workspace/go"; - }; -} diff --git a/users/fcuny/i3.nix b/users/fcuny/i3.nix deleted file mode 100644 index dd01348..0000000 --- a/users/fcuny/i3.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ config, pkgs, lib, hostname, ... }: -let - mod = "Mod4"; -in -{ - xsession.enable = true; - - xsession.windowManager.i3 = { - enable = true; - config = { - modifier = mod; - terminal = "${pkgs.alacritty}/bin/alacritty"; - window = { - titlebar = false; - border = 2; - }; - keybindings = lib.mkOptionDefault { - "${mod}+r" = "exec --no-startup-id ${pkgs.rofi}/bin/rofi -show drun"; - "${mod}+l" = "exec ${pkgs.systemd}/bin/loginctl lock-session"; - }; - bars = [ ]; - }; - }; - - programs.rofi = { - enable = true; - theme = "purple"; - terminal = "${pkgs.alacritty}/bin/alacritty"; - extraConfig = { - modi = "drun"; - show-icons = true; - combi-modi = "window,drun,ssh"; - }; - }; - - xdg.configFile."polybar/aptos.ini".source = ../../configs/polybar/aptos.ini; - xdg.configFile."polybar/carmel.ini".source = ../../configs/polybar/carmel.ini; - xdg.configFile."polybar/modules".source = ../../configs/polybar/modules; - - services.polybar = { - enable = true; - package = pkgs.polybarFull; - script = "polybar --config=${config.xdg.configHome}/polybar/${hostname}.ini -r alone &"; - }; -} diff --git a/users/fcuny/media.nix b/users/fcuny/media.nix deleted file mode 100644 index 57d0dd2..0000000 --- a/users/fcuny/media.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = [ - pkgs.mpd - pkgs.ncmpcpp - ]; - - xdg.configFile."mpd/mpd.conf".source = ../../configs/mpd/mpd.conf; - xdg.configFile."ncmpcpp/config".source = ../../configs/ncmpcpp/config; - - services.mpd = { - enable = true; - }; -} diff --git a/users/fcuny/pass.nix b/users/fcuny/pass.nix deleted file mode 100644 index d430ec8..0000000 --- a/users/fcuny/pass.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, config, ... }: - -{ - programs.password-store.enable = true; - - programs.password-store.settings.PASSWORD_STORE_DIR = - "${config.xdg.dataHome}/password-store"; -} diff --git a/users/fcuny/terminal.nix b/users/fcuny/terminal.nix deleted file mode 100644 index ca3b2e8..0000000 --- a/users/fcuny/terminal.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, pkgs, lib, ...}: - -{ - programs.alacritty = { - enable = true; - - settings = { - env = { - TERM = "xterm-256color"; - WINIT_X11_SCALE_FACTOR = "1.2"; - }; - draw_bold_text_with_bright_colors = true; - selection = { - save_to_clipboard = true; - }; - font = { - size = 12; - }; - }; - }; -} diff --git a/users/fcuny/tmux.nix b/users/fcuny/tmux.nix deleted file mode 100644 index 1a9a2d4..0000000 --- a/users/fcuny/tmux.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - programs.tmux = { - enable = true; - terminal = "xterm-256color"; - escapeTime = 0; - aggressiveResize = true; - shortcut = "z"; - - extraConfig = '' - setw -g mouse on - ''; - }; -} diff --git a/users/fcuny/zsh.nix b/users/fcuny/zsh.nix deleted file mode 100644 index 6b56d35..0000000 --- a/users/fcuny/zsh.nix +++ /dev/null @@ -1,21 +0,0 @@ -{config, lib, pkgs, ...}: - -{ - - xdg.configFile."zsh/personal".source = config.lib.file.mkOutOfStoreSymlink ../../configs/zsh; - - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - defaultKeymap = "emacs"; - history = { - save = 100000; - extended = true; - ignoreDups = true; - }; - initExtra = '' - source ${config.xdg.configHome}/zsh/personal/init.zsh - ''; - }; -} -- cgit 1.4.1