dregil: Integrate my home configuration

This commit is contained in:
Alexander Kobjolke 2024-01-29 22:20:57 +01:00
parent 59512e77ef
commit e607d83f49
7 changed files with 202 additions and 12 deletions

View file

@ -76,6 +76,7 @@
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ ./hosts/dregil ]; modules = [ ./hosts/dregil ];
}; };
homeConfigurations = import ./outputs/homeConfigurations inputs; homeConfigurations = import ./outputs/homeConfigurations inputs;
nixosConfigurations."igor" = nixpkgs-unstable.lib.nixosSystem { nixosConfigurations."igor" = nixpkgs-unstable.lib.nixosSystem {

17
home/alex/default.nix Normal file
View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, inputs, ... }:
let electron-overlay = final: prev: { electron = final.electron_25; };
in {
imports = [{ nixpkgs.overlays = [ inputs.emacs.overlay ]; }];
users.users."alex" = {
isNormalUser = true;
extraGroups = [ "input" "networkmanager" "wheel" ];
description = "Alexander Kobjolke";
home = "/home/alex";
shell = pkgs.zsh;
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.alex = import ./home.nix;
}

92
home/alex/home.nix Normal file
View file

@ -0,0 +1,92 @@
{ config, lib, pkgs, ... }:
{
imports = [ ../cli.nix ];
home = {
homeDirectory = "/home/alex";
stateVersion = "21.05";
sessionPath = [ "$HOME/.local/bin" "$HOME/.emacs.d/bin" ];
shellAliases = { e = "emacsclient -c $@"; };
language.base = "en_US.UTF-8";
keyboard.layout = "us";
keyboard.variant = "dvorak";
keyboard.options =
[ "terminate:ctrl_alt_bksp" "caps:escape" "compose:ralt" ];
packages = with pkgs; [
# social
(jitsi-meet-electron.overrideAttrs (prev: rec {
version = "2023.10.0";
src = fetchurl {
url =
"https://github.com/jitsi/jitsi-meet-electron/releases/download/v${version}/jitsi-meet-x86_64.AppImage";
sha256 = "sha256-zhOx/gdsiQMuOCCE5sn+JNu0WJrH36XfvqqNvE24St8=";
name = "jitsi-meet-electron-${version}.AppImage";
};
})) # jitsi as a stand-alone app
discord # talk to other people
# system tools
uhk-agent # my keyboard
mosh # ssh via udp
# gaming support
lutris
winePackages.stagingFull
# reading
calibre
];
};
news.display = "silent";
programs = {
alacritty.enable = true;
# autorandr.enable = true;
browserpass = {
enable = true;
browsers = [ "firefox" ];
};
feh.enable = true;
firefox = {
enable = true;
package = pkgs.firefox.override {
cfg = {
enableGnomeExtensions = true;
enableTridactylNative = true;
enableBrowserpass = true;
};
};
};
mpv.enable = true;
rofi.enable = true;
rofi.pass.enable = true;
zathura.enable = true;
zsh = let
auth-socket-env = ''
export SSH_AUTH_SOCK="$(${pkgs.gnupg}/bin/gpgconf -L agent-ssh-socket)"
'';
in {
enable = true;
loginExtra = auth-socket-env;
initExtra = auth-socket-env;
};
};
services.gpg-agent = {
enable = true;
enableSshSupport = true;
sshKeys = [ "9027AB16B9A7C20BD29F30F55CBA054430BF014C" ];
};
# services.autorandr = { enable = true; };
xsession.enable = true;
}

View file

@ -0,0 +1,77 @@
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Util.EZConfig
import XMonad.Util.Loggers
import XMonad.Util.Ungrab
import XMonad.Layout.Magnifier
import XMonad.Layout.ThreeColumns
import XMonad.Hooks.EwmhDesktops
main :: IO ()
main = xmonad
. ewmhFullscreen
. ewmh
. withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey
$ myConfig
myConfig = def
{ modMask = mod4Mask -- Rebind Mod to the Super key
, layoutHook = myLayout -- Use custom layouts
, manageHook = myManageHook -- Match on certain windows
}
`additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock")
, ("M-C-s", unGrab *> spawn "scrot -s" )
, ("M-f" , spawn "firefox" )
]
myManageHook :: ManageHook
myManageHook = composeAll
[ className =? "Gimp" --> doFloat
, isDialog --> doFloat
]
myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol
where
threeCol = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio
tiled = Tall nmaster delta ratio
nmaster = 1 -- Default number of windows in the master pane
ratio = 1/2 -- Default proportion of screen occupied by master pane
delta = 3/100 -- Percent of screen to increment by when resizing panes
myXmobarPP :: PP
myXmobarPP = def
{ ppSep = magenta ""
, ppTitleSanitize = xmobarStrip
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2
, ppHidden = white . wrap " " ""
, ppHiddenNoWindows = lowWhite . wrap " " ""
, ppUrgent = red . wrap (yellow "!") (yellow "!")
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
-- | Windows should have *some* title, which should not not exceed a
-- sane length.
ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
blue, lowWhite, magenta, red, white, yellow :: String -> String
magenta = xmobarColor "#ff79c6" ""
blue = xmobarColor "#bd93f9" ""
white = xmobarColor "#f8f8f2" ""
yellow = xmobarColor "#f1fa8c" ""
red = xmobarColor "#ff5555" ""
lowWhite = xmobarColor "#bbbbbb" ""

View file

@ -0,0 +1,12 @@
{ config, lib, pkgs, ... }:
{
xsession = {
windowManager.xmonad = {
enable = true;
enableContribAndExtra = true;
extraPackages = hp: [ hp.dbus hp.monad-logger hp.xmonad-contrib ];
config = ./config.hs;
};
};
}

View file

@ -17,7 +17,7 @@ in {
./hardware-configuration.nix ./hardware-configuration.nix
# <nixos-hardware/lenovo/legion/15ich> # <nixos-hardware/lenovo/legion/15ich>
../../modules/wm/x.nix ../../modules/wm/x.nix
# ../../modules/wm/xmonad.nix ../../modules/wm/xmonad.nix
]; ];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
@ -68,16 +68,6 @@ in {
sound.enable = true; sound.enable = true;
hardware.pulseaudio.enable = true; hardware.pulseaudio.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.alex = {
isNormalUser = true;
extraGroups = [
"wheel" # Enable sudo for the user.
"input"
];
shell = pkgs.zsh;
};
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -11,6 +11,7 @@
../../modules/common-system.nix ../../modules/common-system.nix
./configuration.nix ./configuration.nix
inputs.home-manager-unstable.nixosModules.home-manager inputs.home-manager-unstable.nixosModules.home-manager
../../home/anne ../../home/anne/default.nix
../../home/alex/default.nix
]; ];
} }