diff options
| author | kdam0 <me@kumardamani.net> | 2023-04-07 16:44:12 +0000 |
|---|---|---|
| committer | kdam0 <me@kumardamani.net> | 2023-04-07 16:44:12 +0000 |
| commit | fc384fc48e05f17f2d28a7a7d2b0b1802eabea53 (patch) | |
| tree | d6f192fd13eba83c9dabf25908d7787b8964dbc3 | |
| parent | ec5c16831076b0f295172fbba93a965b16c8539a (diff) | |
major updates, breaking changes
16 files changed, 405 insertions, 14 deletions
diff --git a/nix/.config/nix/nix.conf b/nix/.config/nix/nix.conf new file mode 100644 index 0000000..c7d7291 --- /dev/null +++ b/nix/.config/nix/nix.conf @@ -0,0 +1 @@ +experimental-features = nix-command flakes diff --git a/bg.sh b/nixpkgs/.config/nixpkgs/common/bg.sh index 9bcefa6..9bcefa6 100755 --- a/bg.sh +++ b/nixpkgs/.config/nixpkgs/common/bg.sh diff --git a/nixpkgs/.config/nixpkgs/common/dwl_3/config.h b/nixpkgs/.config/nixpkgs/common/dwl_3/config.h new file mode 100644 index 0000000..30c8ec2 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/common/dwl_3/config.h @@ -0,0 +1,135 @@ +#include <X11/XF86keysym.h> + +/* appearance */ +static const int sloppyfocus = 1; /* focus follows mouse */ +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ +static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0}; +static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; +static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + +static const Rule rules[] = { + /* app_id title tags mask isfloating monitor */ + /* examples: + { "Gimp", NULL, 0, 1, -1 }, + */ + { "firefox", NULL, 1 << 8, 0, -1 }, +}; + +/* layout(s) */ +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, +}; + +/* monitors */ +static const MonitorRule monrules[] = { + /* name mfact nmaster scale layout rotate/reflect */ + /* example of a HiDPI laptop monitor: + { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, + */ + /* defaults */ + { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL }, +}; + +/* keyboard */ +static const struct xkb_rule_names xkb_rules = { + /* can specify fields: rules, model, layout, variant, options */ + /* example: + .options = "ctrl:nocaps", + */ + .options = "caps:escape", +}; + +static const int repeat_rate = 25; +static const int repeat_delay = 600; + +/* Trackpad */ +static const int tap_to_click = 1; +static const int natural_scrolling = 0; + +/* If you want to use the windows key change this to WLR_MODIFIER_LOGO */ +#define MODKEY WLR_MODIFIER_ALT +#define TAGKEYS(KEY,SKEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} } + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + + +/* commands */ +static const char *termcmd[] = { "foot", NULL }; +static const char *menucmd[] = { "wofi", "--show", "run", NULL }; +static const char *volmute[] = { "amixer", "set", "Master", "toggle", NULL }; +static const char *voldown[] = { "amixer", "set", "Master", "10%-", NULL }; +static const char *volup[] = { "amixer", "set", "Master", "10%+", NULL }; +static const char *brightdown[] = { "light", "-U", "10", NULL }; +static const char *brightup[] = { "light", "-A", "10", NULL }; +static const char *hibernatecmd[] = { "systemctl", "hibernate", NULL }; + +static const Key keys[] = { + /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ + /* modifier key function argument */ + { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, + { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, + { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, + { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} }, + { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, + { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} }, + { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} }, + { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY, XKB_KEY_Tab, view, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, + { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, + { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XKB_KEY_space, setlayout, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, + { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, + { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, + { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, + { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} }, + // custom binds + { 0, XKB_KEY_XF86AudioMute, spawn, {.v = volmute} }, + { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = voldown} }, + { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = volup} }, + { 0, XKB_KEY_XF86MonBrightnessDown, spawn, {.v = brightdown} }, + { 0, XKB_KEY_XF86MonBrightnessUp, spawn, {.v = brightup} }, + { 0, XKB_KEY_Print, spawn, SHCMD("slurp | grim -g - - | wl-copy && notify-send 'Copied selection to clipboard!' && wl-paste > $HOME/pics/$(date +'%Y-%m-%d-%H%M%S_grim.png')") }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Delete, spawn, {.v = hibernatecmd} }, + TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), + TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), + TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), + TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3), + TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4), + TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5), + TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6), + TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7), + TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8), + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} }, + + /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ + { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} }, +#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} } + CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6), + CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12), +}; + +static const Button buttons[] = { + { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, + { MODKEY, BTN_MIDDLE, togglefloating, {0} }, + { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, +}; + diff --git a/nixpkgs/.config/nixpkgs/dwl/config.h b/nixpkgs/.config/nixpkgs/common/dwl_4/config.h index 346111e..346111e 100644 --- a/nixpkgs/.config/nixpkgs/dwl/config.h +++ b/nixpkgs/.config/nixpkgs/common/dwl_4/config.h diff --git a/foot/.config/foot/foot.ini b/nixpkgs/.config/nixpkgs/common/foot/foot.ini index dc9ed5e..e0ed811 100644 --- a/foot/.config/foot/foot.ini +++ b/nixpkgs/.config/nixpkgs/common/foot/foot.ini @@ -1,2 +1,3 @@ [colors] alpha=0.7 + diff --git a/mako/.config/mako/config b/nixpkgs/.config/nixpkgs/common/mako/config index 9ddfc3b..52a21f1 100644 --- a/mako/.config/mako/config +++ b/nixpkgs/.config/nixpkgs/common/mako/config @@ -22,3 +22,4 @@ border-color=#d08770 border-color=#bf616a default-timeout=0 + diff --git a/start.sh b/nixpkgs/.config/nixpkgs/common/start.sh index db88d91..3dd6cf0 100755 --- a/start.sh +++ b/nixpkgs/.config/nixpkgs/common/start.sh @@ -2,16 +2,9 @@ # This a sort-of auto-start script. # Run this from a tty to start my graphical env. -# don't need it anymore? -#echo $(id -u) -#export XDG_RUNTIME_DIR=/tmp/xdg-runtime-$(id -u) -#mkdir -p $XDG_RUNTIME_DIR -#echo $XDG_RUNTIME_DIR - export EDITOR=nvim exec dwl -s 'somebar' & -#exec sway & # set blocks on bar exec /usr/local/bin/someblocks & @@ -19,6 +12,7 @@ exec /usr/local/bin/someblocks & # give wayland session some time to init sleep 1 +exec mako & + # set bg exec ./bg.sh & - diff --git a/wofi/.config/wofi/style.css b/nixpkgs/.config/nixpkgs/common/wofi/style.css index e91d682..ba73e91 100644 --- a/wofi/.config/wofi/style.css +++ b/nixpkgs/.config/nixpkgs/common/wofi/style.css @@ -55,3 +55,4 @@ padding: 5px; } + diff --git a/nixpkgs/.config/nixpkgs/flake.nix b/nixpkgs/.config/nixpkgs/flake.nix index 8be77de..d831b32 100644 --- a/nixpkgs/.config/nixpkgs/flake.nix +++ b/nixpkgs/.config/nixpkgs/flake.nix @@ -9,17 +9,20 @@ }; outputs = inputs@{ nixpkgs, home-manager, nixos-hardware, ... }: { + # NixOS + Home Manager nixosConfigurations = { "art-sr" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./configuration.nix + #./configuration.nix + ./per-user/kdam0-home/configuration.nix nixos-hardware.nixosModules.framework home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users.kdam0 = import ./home.nix; + #home-manager.users.kdam0 = import ./home.nix; + home-manager.users.kdam0 = import ./per-user/kdam0-home/home.nix; # Optionally, use home-manager.extraSpecialArgs to pass # arguments to home.nix @@ -27,5 +30,19 @@ ]; }; }; + + # Home Manager Only + homeConfigurations = { + "kdam0" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages."x86_64-linux"; + modules = [ + ./per-user/kdam0-work/home.nix + ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; + }; } diff --git a/nixpkgs/.config/nixpkgs/configuration.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/configuration.nix index 903bab8..903bab8 100644 --- a/nixpkgs/.config/nixpkgs/configuration.nix +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/configuration.nix diff --git a/nixpkgs/.config/nixpkgs/hardware-configuration.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hardware-configuration.nix index 7911403..7911403 100644 --- a/nixpkgs/.config/nixpkgs/hardware-configuration.nix +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hardware-configuration.nix diff --git a/nixpkgs/.config/nixpkgs/home.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/home.nix index 33f3d00..a757ccc 100644 --- a/nixpkgs/.config/nixpkgs/home.nix +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/home.nix @@ -16,9 +16,9 @@ ".." = "cd .."; up = "sudo nixos-rebuild switch"; clean = "sudo nix-collect-garbage -d"; - cdwl = "nvim ~/.config/nixpkgs/dwl/config.h"; - chm = "nvim ~/.config/nixpkgs/home.nix"; - cnix = "nvim ~/.config/nixpkgs/configuration.nix"; + cdwl = "nvim ~/.config/nixpkgs/common/dwl_4/config.h"; + chm = "nvim ~/.config/nixpkgs/per-user/kdam0-home/home.nix"; + cnix = "nvim ~/.config/nixpkgs/per-user/kdam0-home/configuration.nix"; gst = "git status"; v = "nvim $@"; search = "nix search nixpkgs $@"; @@ -39,6 +39,15 @@ terminal = "screen-256color"; keyMode = "vi"; }; + programs.git = { + enable = true; + userName = "Kumar Damani"; + userEmail = "me@kumardamani.net"; + aliases = { + lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + }; + }; + home.stateVersion = "22.11"; home.packages = [ @@ -47,7 +56,7 @@ # trying to supply config.home.homeDirectory here leads to "impure" usage. # so disabling it for now # conf = (builtins.readFile "${config.home.homeDirectory}/.config/dwl/config.h"); - conf = ./dwl/config.h; + conf = ../../common/dwl_4/config.h; }) pkgs.somebar pkgs.foot @@ -62,6 +71,8 @@ # Browsers pkgs.firefox pkgs.brave + #pkgs.vivaldi + #pkgs.vivaldi-ffmprg-codecs # File Managers pkgs.ranger pkgs.pcmanfm @@ -96,6 +107,15 @@ pkgs.nextcloud-client pkgs.ripgrep pkgs.fd + pkgs.stow + # Comms + pkgs.signal-desktop + #pkgs.mattermost-desktop + pkgs.mutt-wizard + pkgs.isync + pkgs.msmtp + pkgs.pass + pkgs.neomutt ]; fonts.fontconfig.enable = true; @@ -139,4 +159,16 @@ }; }; systemd.user.startServices = true; + + # Source app specific configs + home.file."bg.sh".source = ../../common/bg.sh; + home.file."start.sh".source = ../../common/start.sh; + home.file.".config/foot/foot.ini".source = ../../common/foot/foot.ini; + home.file.".config/wofi/style.css".source = ../../common/wofi/style.css; + home.file.".config/mako/config".source = ../../common/mako/config; + + #home.file.".config/foot/foot.ini".text = '' + #[colors] + #alpha=0. + #''; } diff --git a/nixpkgs/.config/nixpkgs/hosts.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hosts.nix index 8f21ea8..8f21ea8 100644 --- a/nixpkgs/.config/nixpkgs/hosts.nix +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-home/hosts.nix diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.lock b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.lock new file mode 100644 index 0000000..bd81372 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.lock @@ -0,0 +1,65 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1680555990, + "narHash": "sha256-Tu/i5sd0hk4c4VtWO8XpY3c9KmHDcOWF5Y2GSCh3LXA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "d6f3ba090ed090ae664ab5bac329654093aae725", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-22.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1680334310, + "narHash": "sha256-ISWz16oGxBhF7wqAxefMPwFag6SlsA9up8muV79V9ck=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "884e3b68be02ff9d61a042bc9bd9dd2a358f95da", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.nix new file mode 100644 index 0000000..4be5cdb --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/flake.nix @@ -0,0 +1,31 @@ +{ + description = "Home Manager configuration of kumar"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; + home-manager = { + url = "github:nix-community/home-manager/release-22.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, home-manager, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + homeConfigurations.kdam0 = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ + ./home.nix + ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; +} diff --git a/nixpkgs/.config/nixpkgs/per-user/kdam0-work/home.nix b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/home.nix new file mode 100644 index 0000000..b8a6a72 --- /dev/null +++ b/nixpkgs/.config/nixpkgs/per-user/kdam0-work/home.nix @@ -0,0 +1,113 @@ +{ config, pkgs, libs, ...}: +{ + home.username = "kdam0"; + home.homeDirectory = "/home/kdam0"; + + programs.home-manager.enable = true; + programs.zsh = { + enable = true; + defaultKeymap = "viins"; + initExtra = '' + source ${config.home.homeDirectory}/.p10k.zsh + ''; + shellAliases = { + l = "ls -l"; + ll = "ls -al"; + ".." = "cd .."; + cdwl = "nvim ~/.config/nixpkgs/common/dwl_3/config.h"; + chm = "nvim ~/.config/nixpkgs/per-user/kdam0-work/home.nix"; + gst = "git status"; + v = "nvim $@"; + search = "nix search nixpkgs $@"; + conf = "ranger ~/.config/nixpkgs/common/"; + }; + zplug = { + enable = true; + plugins = [ + { name = "zsh-users/zsh-autosuggestions"; } + { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } + ]; + }; + }; + programs.tmux = { + enable = true; + clock24 = true; + shell = "${pkgs.zsh}/bin/zsh"; + prefix = "C-a"; + terminal = "screen-256color"; + keyMode = "vi"; + }; + + home.stateVersion = "22.11"; + home.packages = [ + # Window environment + (pkgs.dwl.override { + # trying to supply config.home.homeDirectory here leads to "impure" usage. + # so disabling it for now + # conf = (builtins.readFile "${config.home.homeDirectory}/.config/dwl/config.h"); + conf = ../../common/dwl_3/config.h; + }) + pkgs.somebar + pkgs.foot + pkgs.wofi + pkgs.wl-clipboard + pkgs.wf-recorder + pkgs.grim + pkgs.slurp + pkgs.polkit + pkgs.light + pkgs.wbg + # Text Editors + pkgs.neovim + # Browsers + pkgs.firefox + pkgs.brave + # File Managers + pkgs.ranger + pkgs.pcmanfm + pkgs.gvfs + # Fonts + pkgs.nerdfonts + pkgs.hack-font + # Notifications + pkgs.mako + pkgs.libnotify + # Image viewer + pkgs.imv + # Video player + pkgs.mpv + # Pdf Viewer + pkgs.zathura + # Power stuff + pkgs.acpi + # Other stuff + pkgs.gnumake + pkgs.clang + pkgs.neofetch + pkgs.trash-cli + pkgs.nextcloud-client + pkgs.ripgrep + pkgs.fd + ]; + + fonts.fontconfig.enable = true; + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = true; + }; + + # Source app specific configs + home.file."bg.sh".source = ../../common/bg.sh; + home.file."start.sh".source = ../../common/start.sh; + home.file.".config/foot/foot.ini".source = ../../common/foot/foot.ini; + home.file.".config/wofi/style.css".source = ../../common/wofi/style.css; + home.file.".config/mako/config".source = ../../common/mako/config; + + #home.file.".config/foot/foot.ini".text = '' + #[colors] + #alpha=0.7 + #''; +} + |
