Compare commits

..

3 commits

22 changed files with 468 additions and 421 deletions

View file

@ -5,16 +5,13 @@
_utils, _utils,
agenix, agenix,
camasca, camasca,
home-manager, hjem,
nixpkgs, nixpkgs,
nix-index-database, nix-index-database,
vencord, vencord,
... ...
}: }:
let let
username = "leo";
stateVersion = "24.11";
rootPassword = _utils.setupSingleSecret config "rootPassword" { }; rootPassword = _utils.setupSingleSecret config "rootPassword" { };
secrets = _utils.setupSharedSecrets config { secrets = _utils.setupSharedSecrets config {
secrets = [ "userPassword" ]; secrets = [ "userPassword" ];
@ -23,10 +20,10 @@ in
{ {
imports = [ imports = [
agenix.nixosModules.default agenix.nixosModules.default
home-manager.nixosModules.home-manager hjem.nixosModules.default
nix-index-database.nixosModules.nix-index nix-index-database.nixosModules.nix-index
(lib.mkAliasOptionModule [ "hm" ] [ "home-manager" "users" username ]) (lib.mkAliasOptionModule [ "hj" ] [ "hjem" "users" "leo" "files" ])
rootPassword.generate rootPassword.generate
secrets.generate secrets.generate
@ -71,21 +68,17 @@ in
wget wget
]; ];
hm = { hjem = {
home = { inherit stateVersion; }; clobberByDefault = true;
users.leo.files = {
programs.ssh = { ".ssh/config".text = ''
enable = true; Host *
addKeysToAgent = "yes"; ForwardAgent yes
forwardAgent = true; AddKeysToAgent yes
'';
}; };
}; };
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
networking = { networking = {
@ -196,7 +189,7 @@ in
time.timeZone = "Europe/Paris"; time.timeZone = "Europe/Paris";
users.users = { users.users = {
"${username}" = { leo = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish; shell = pkgs.fish;
extraGroups = [ extraGroups = [
@ -225,5 +218,5 @@ in
# this value at the release version of the first install of this system. # this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = lib.mkDefault stateVersion; # Did you read the comment? system.stateVersion = lib.mkDefault "24.11"; # Did you read the comment?
} }

View file

@ -14,6 +14,7 @@
../programs/ghostty.nix ../programs/ghostty.nix
../programs/gnome.nix ../programs/gnome.nix
../programs/java.nix ../programs/java.nix
../programs/neovim/neovide.nix
]; ];
boot = { boot = {
@ -44,8 +45,30 @@
sbctl sbctl
wl-clipboard wl-clipboard
chromium
(discord.override {
withOpenASAR = true;
withVencord = true;
})
gimp3
gparted
idea-wrapped
mpv
obsidian
strawberry
teams-for-linux
thunderbird
vscode
niigo-miku-cursors niigo-miku-cursors
patchouli-cursors patchouli-cursors
# libreoffice stuff
libreoffice-qt6-fresh
hunspell
hunspellDicts.en_US
hunspellDicts.fr-moderne
]; ];
sessionVariables = { sessionVariables = {
@ -77,32 +100,6 @@
enable32Bit = true; enable32Bit = true;
}; };
hm.imports = [ ../programs/neovim/neovide.nix ];
hm.home = {
packages = with pkgs; [
chromium
(discord.override {
withOpenASAR = true;
withVencord = true;
})
gimp3
gparted
idea-wrapped
mpv
obsidian
strawberry
teams-for-linux
thunderbird
vscode
# libreoffice stuff
libreoffice-qt6-fresh
hunspell
hunspellDicts.en_US
hunspellDicts.fr-moderne
];
};
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_FR.UTF-8"; LC_ADDRESS = "fr_FR.UTF-8";
LC_IDENTIFICATION = "fr_FR.UTF-8"; LC_IDENTIFICATION = "fr_FR.UTF-8";

View file

@ -2,6 +2,7 @@
lib, lib,
pkgs, pkgs,
config, config,
_utils,
... ...
}: }:
{ {
@ -32,8 +33,10 @@
# hyprland stuff # hyprland stuff
services.blueman = lib.mkIf config.programs.hyprland.enable { enable = true; }; services.blueman = lib.mkIf config.programs.hyprland.enable { enable = true; };
hm.wayland.windowManager.hyprland.settings.exec-once = with pkgs; [ hj.".config/hypr/hyprland.conf".text = _utils.toHyprconf {
"${lib.getExe networkmanagerapplet}" exec-once = with pkgs; [
"${lib.getExe' blueman "blueman-applet"}" "${lib.getExe networkmanagerapplet}"
]; "${lib.getExe' blueman "blueman-applet"}"
];
};
} }

22
flake.lock generated
View file

@ -3,9 +3,7 @@
"agenix": { "agenix": {
"inputs": { "inputs": {
"darwin": [], "darwin": [],
"home-manager": [ "home-manager": [],
"home-manager"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -145,23 +143,23 @@
"type": "github" "type": "github"
} }
}, },
"home-manager": { "hjem": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1746413188, "lastModified": 1746355589,
"narHash": "sha256-i6BoiQP0PasExESQHszC0reQHfO6D4aI2GzOwZMOI20=", "narHash": "sha256-LguszqsDBTtdBxblQTtN7vOAYmfoe43aHkB8aK1dChE=",
"owner": "nix-community", "owner": "feel-co",
"repo": "home-manager", "repo": "hjem",
"rev": "8a318641ac13d3bc0a53651feaee9560f9b2d89a", "rev": "77b37eeb583d43e1c723119a69c906235174ce57",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "feel-co",
"repo": "home-manager", "repo": "hjem",
"type": "github" "type": "github"
} }
}, },
@ -283,7 +281,7 @@
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"getchvim": "getchvim", "getchvim": "getchvim",
"home-manager": "home-manager", "hjem": "hjem",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"mystia": "mystia", "mystia": "mystia",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",

View file

@ -68,7 +68,7 @@
url = "github:uku3lig/agenix"; url = "github:uku3lig/agenix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems"; inputs.systems.follows = "systems";
inputs.home-manager.follows = "home-manager"; inputs.home-manager.follows = "";
inputs.darwin.follows = ""; inputs.darwin.follows = "";
}; };
@ -89,8 +89,8 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager = { hjem = {
url = "github:nix-community/home-manager"; url = "github:feel-co/hjem";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };

View file

@ -111,4 +111,62 @@
alias = builtins.toString (pkgs.writeTextDir filename content) + "/"; alias = builtins.toString (pkgs.writeTextDir filename content) + "/";
tryFiles = "${filename} =${builtins.toString status}"; tryFiles = "${filename} =${builtins.toString status}";
}; };
# https://github.com/nix-community/home-manager/blob/ec71b5162848e6369bdf2be8d2f1dd41cded88e8/modules/lib/generators.nix#L4-L61
toHyprconf =
attrs:
let
inherit (lib)
all
concatMapStringsSep
concatStrings
concatStringsSep
filterAttrs
foldl
generators
hasPrefix
isAttrs
isList
mapAttrsToList
replicate
;
indentLevel = 0;
importantPrefixes = [ "$" ];
initialIndent = concatStrings (replicate indentLevel " ");
toHyprconf' =
indent: attrs:
let
sections = filterAttrs (n: v: isAttrs v || (isList v && all isAttrs v)) attrs;
mkSection =
n: attrs:
if lib.isList attrs then
(concatMapStringsSep "\n" (a: mkSection n a) attrs)
else
''
${indent}${n} {
${toHyprconf' " ${indent}" attrs}${indent}}
'';
mkFields = generators.toKeyValue {
listsAsDuplicateKeys = true;
inherit indent;
};
allFields = filterAttrs (n: v: !(isAttrs v || (isList v && all isAttrs v))) attrs;
isImportantField =
n: _: foldl (acc: prev: if hasPrefix prev n then true else acc) false importantPrefixes;
importantFields = filterAttrs isImportantField allFields;
fields = builtins.removeAttrs allFields (mapAttrsToList (n: _: n) importantFields);
in
mkFields importantFields
+ concatStringsSep "\n" (mapAttrsToList mkSection sections)
+ mkFields fields;
in
toHyprconf' initialIndent attrs;
} }

View file

@ -3,24 +3,23 @@
pkgs, pkgs,
... ...
}: }:
{ let
hm.programs.alacritty = toml = pkgs.formats.toml { };
let
theme = pkgs.fetchurl {
# url = "https://raw.githubusercontent.com/catppuccin/alacritty/ce476fb41f307d90f841c1a4fd7f0727c21248b2/catppuccin-macchiato.toml";
url = "https://raw.githubusercontent.com/rose-pine/alacritty/3c3e36eb5225b0eb6f1aa989f9d9e783a5b47a83/dist/rose-pine.toml";
hash = "sha256-MheSmzz02ZLAOS2uaclyazu6E//eikcdFydFfkio0/U=";
};
themeAttr = builtins.fromTOML (builtins.readFile theme); theme = pkgs.fetchurl {
in # url = "https://raw.githubusercontent.com/catppuccin/alacritty/ce476fb41f307d90f841c1a4fd7f0727c21248b2/catppuccin-macchiato.toml";
{ url = "https://raw.githubusercontent.com/rose-pine/alacritty/3c3e36eb5225b0eb6f1aa989f9d9e783a5b47a83/dist/rose-pine.toml";
enable = true; hash = "sha256-MheSmzz02ZLAOS2uaclyazu6E//eikcdFydFfkio0/U=";
settings = lib.recursiveUpdate themeAttr { };
font = { themeAttr = builtins.fromTOML (builtins.readFile theme);
normal.family = "Iosevka Nerd Font"; in
size = 12; {
}; hj.".config/alacritty/alacritty.toml".source = toml.generate "alacritty.toml" (
lib.recursiveUpdate themeAttr {
font = {
normal.family = "Iosevka Nerd Font";
size = 12;
}; };
}; }
);
} }

View file

@ -6,17 +6,16 @@
fishPlugins.hydro fishPlugins.hydro
]; ];
hm.programs.fish = { hj.".config/fish/config.fish".text = ''
enable = true; function fish_greeting
end
interactiveShellInit = '' if status is-interactive
set --global hydro_symbol_git_dirty "*" set --global hydro_symbol_git_dirty "*"
set --global hydro_color_pwd blue set --global hydro_color_pwd blue
set --global hydro_color_git magenta set --global hydro_color_git magenta
set --global hydro_color_prompt green set --global hydro_color_prompt green
set --global hydro_color_duration yellow set --global hydro_color_duration yellow
''; end
'';
functions.fish_greeting = "";
};
} }

View file

@ -1,24 +1,24 @@
{ lib, pkgs, ... }:
{ {
hm.programs.fuzzel = { environment.systemPackages = [ pkgs.fuzzel ];
enable = true;
settings = {
main = {
font = "Iosevka Nerd Font:size=16";
dpi-aware = false;
horizontal-pad = 20;
};
border.radius = 8; hj.".config/fuzzel/fuzzel.ini".text = lib.generators.toINI { } {
main = {
font = "Iosevka Nerd Font:size=16";
dpi-aware = false;
horizontal-pad = 20;
};
colors = { border.radius = 8;
background = "24273aff"; # base
border = "91d7e3cc"; # sky colors = {
text = "cad3f5ff"; # text background = "24273aff"; # base
match = "a6da95ff"; # green border = "91d7e3cc"; # sky
selection = "f4dbd6ff"; # rosewater text = "cad3f5ff"; # text
selection-text = "181926ff"; # crust match = "a6da95ff"; # green
selection-match = "40a02bff"; # latte green selection = "f4dbd6ff"; # rosewater
}; selection-text = "181926ff"; # crust
selection-match = "40a02bff"; # latte green
}; };
}; };
} }

View file

@ -5,7 +5,7 @@
xpadneo.enable = true; xpadneo.enable = true;
}; };
hm.home.packages = with pkgs; [ environment.systemPackages = with pkgs; [
obs-studio obs-studio
osu-lazer-bin osu-lazer-bin
krita krita

View file

@ -1,14 +1,12 @@
{ pkgs, ... }:
{ {
hm.programs.ghostty = { environment.systemPackages = [ pkgs.ghostty ];
enable = true;
settings = { hj.".config/ghostty/config".text = ''
theme = "light:catppuccin-latte,dark:catppuccin-mocha"; font-family = Iosevka Term
font-family = "Iosevka Term"; font-feature = -calt
font-size = 12; font-feature = -dlig
font-feature = [ font-size = 12
"-calt" theme = light:catppuccin-latte,dark:catppuccin-mocha
"-dlig" '';
];
};
};
} }

View file

@ -1,36 +1,36 @@
{ config, ... }: { lib, pkgs, ... }:
{ {
programs.git.enable = true; environment.systemPackages = with pkgs; [
git
gh
];
hm.programs = { hj = {
git = { ".gitconfig".text = lib.generators.toGitINI {
inherit (config.programs.git) enable package; user = {
userName = "uku"; name = "uku";
userEmail = "hi@uku.moe"; email = "hi@uku.moe";
signingKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN+7+KfdOrhcnHayxvOENUeMx8rE4XEIV/AxMHiaNUP8";
signing = {
format = "ssh";
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN+7+KfdOrhcnHayxvOENUeMx8rE4XEIV/AxMHiaNUP8";
signByDefault = true;
}; };
# delta.enable = true; commit = {
gpgSign = true;
extraConfig = { verbose = true;
init.defaultBranch = "main";
core.autocrlf = "input";
push.autoSetupRemote = true;
merge.conflictStyle = "zdiff3";
rebase.autoStash = true;
status.submoduleSummary = true;
diff.submodule = "log";
submodule.recurse = true;
commit.verbose = true;
}; };
gpg.format = "ssh";
tag.gpgSign = true;
core.autocrlf = "input";
diff.submodule = "log";
init.defaultBranch = "main";
merge.conflictStyle = "zdiff3";
push.autoSetupRemote = true;
rebase.autoStash = true;
status.submoduleSummary = true;
submodule.recurse = true;
}; };
gh = { ".config/gh/config.yml".text = lib.generators.toYAML { } {
enable = true;
settings.git_protocol = "ssh"; settings.git_protocol = "ssh";
}; };
}; };

View file

@ -16,14 +16,6 @@
terminal = "ghostty"; terminal = "ghostty";
}; };
hm.programs.gnome-shell = {
enable = true;
extensions = with pkgs.gnomeExtensions; [
{ package = appindicator; }
{ package = dash-to-panel; }
];
};
# ssh-agent is provided by gnome-keyring-daemon # ssh-agent is provided by gnome-keyring-daemon
# (mabye soon by gcr, see NixOS/nixpkgs#140824) # (mabye soon by gcr, see NixOS/nixpkgs#140824)
programs.ssh.startAgent = lib.mkForce false; programs.ssh.startAgent = lib.mkForce false;
@ -32,6 +24,8 @@
systemPackages = [ systemPackages = [
adw-gtk3 adw-gtk3
gnome-tweaks gnome-tweaks
gnomeExtensions.appindicator
gnomeExtensions.dash-to-panel
]; ];
gnome.excludePackages = [ gnome.excludePackages = [

View file

@ -1,8 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
# utility packages for hyprland, since you know it's not a DE # utility packages for hyprland, since you know it's not a DE
environment.systemPackages = with pkgs; [
hm.home.packages = with pkgs; [
gnome.gnome-calculator gnome.gnome-calculator
mate.eom mate.eom
nwg-look nwg-look

View file

@ -1,6 +1,7 @@
{ {
lib, lib,
pkgs, pkgs,
_utils,
... ...
}: }:
{ {
@ -23,168 +24,163 @@
xdg.portal.extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; xdg.portal.extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
hm = { environment.systemPackages = with pkgs; [
home.packages = with pkgs; [ hyprpaper
hyprpaper hyprpicker
hyprpicker wl-clipboard
wl-clipboard cliphist
cliphist swayidle
swayidle swappy
swappy grimblast
grimblast playerctl
playerctl polkit_gnome
polkit_gnome ];
];
wayland.windowManager.hyprland = { hj.".config/hypr/hyprland.conf".text =
enable = true; let
settings = inherit (lib) getExe getExe';
let keys = [
inherit (lib) getExe getExe'; "ampersand"
keys = [ "eacute"
"ampersand" "quotedbl"
"eacute" "apostrophe"
"quotedbl" "parenleft"
"apostrophe" "minus"
"parenleft" "egrave"
"minus" "underscore"
"egrave" "ccedilla"
"underscore" "agrave"
"ccedilla" ];
"agrave" in
]; with pkgs;
in _utils.toHyprconf {
with pkgs; "$mod" = "SUPER";
{ "$wl-paste" = getExe' wl-clipboard "wl-paste";
"$mod" = "SUPER"; "$wpctl" = getExe' wireplumber "wpctl";
"$wl-paste" = getExe' wl-clipboard "wl-paste";
"$wpctl" = getExe' wireplumber "wpctl";
monitor = lib.mkDefault ",highres,auto,1"; monitor = lib.mkDefault ",highres,auto,1";
env = [ env = [
"WLR_DRM_NO_ATOMIC,1" "WLR_DRM_NO_ATOMIC,1"
"SDL_VIDEODRIVER,wayland" "SDL_VIDEODRIVER,wayland"
"MOZ_ENABLE_WAYLAND,1" "MOZ_ENABLE_WAYLAND,1"
"_JAVA_AWT_WM_NONREPARENTING,1" "_JAVA_AWT_WM_NONREPARENTING,1"
"NIXOS_OZONE_WL,1" "NIXOS_OZONE_WL,1"
]; ];
exec-once = [ exec-once = [
"${getExe waybar}" "${getExe waybar}"
"${getExe hyprpaper}" "${getExe hyprpaper}"
"${getExe swayidle} -w" "${getExe swayidle} -w"
"${polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" "${polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"$wl-paste --type text --watch ${getExe cliphist} store" "$wl-paste --type text --watch ${getExe cliphist} store"
"$wl-paste --type image --watch ${getExe cliphist} store" "$wl-paste --type image --watch ${getExe cliphist} store"
]; ];
input = { input = {
kb_layout = "fr"; kb_layout = "fr";
follow_mouse = 1; follow_mouse = 1;
touchpad.drag_lock = true; touchpad.drag_lock = true;
sensitivity = -0.1; sensitivity = -0.1;
accel_profile = "flat"; accel_profile = "flat";
}; };
general = { general = {
gaps_in = 0; gaps_in = 0;
gaps_out = 0; gaps_out = 0;
border_size = 0; border_size = 0;
allow_tearing = true; allow_tearing = true;
}; };
decoration = { decoration = {
drop_shadow = false; drop_shadow = false;
blur.enabled = true; blur.enabled = true;
}; };
animations = { animations = {
enabled = true; enabled = true;
animation = [ animation = [
"windows, 1, 2, default" "windows, 1, 2, default"
"windowsOut, 1, 2, default, popin 90%" "windowsOut, 1, 2, default, popin 90%"
"fade, 1, 2, default" "fade, 1, 2, default"
"workspaces, 1, 3, default" "workspaces, 1, 3, default"
]; ];
}; };
dwindle = { dwindle = {
pseudotile = true; pseudotile = true;
preserve_split = true; preserve_split = true;
force_split = 2; force_split = 2;
}; };
gestures.workspace_swipe = true; gestures.workspace_swipe = true;
windowrulev2 = [ windowrulev2 = [
"float, class:^(pavucontrol)$" "float, class:^(pavucontrol)$"
"suppressevent maximize, class:^(firefox)$" "suppressevent maximize, class:^(firefox)$"
"float, title:^(Picture-in-Picture)$" "float, title:^(Picture-in-Picture)$"
"float, class:^(firefox)$, title:^()$" # notifications "float, class:^(firefox)$, title:^()$" # notifications
"immediate, class:^(cs2)$" "immediate, class:^(cs2)$"
"immediate, class:^(osu.*)$" "immediate, class:^(osu.*)$"
"immediate, class:^(steam_app_1229490)$" # ultrakill "immediate, class:^(steam_app_1229490)$" # ultrakill
# "immediate, class:^(steam_app_\d+)$" # "immediate, class:^(steam_app_\d+)$"
# "immediate, class:^(steam_app_322170)$" # "immediate, class:^(steam_app_322170)$"
]; ];
bind = bind =
[
"$mod, Return, exec, ${getExe alacritty}"
"$mod SHIFT, A, killactive,"
"$mod SHIFT, E, exit,"
"$mod SHIFT, Space, togglefloating,"
"$mod, D, exec, ${getExe fuzzel}"
"$mod, F, fullscreen, 0"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
# audio
",XF86AudioRaiseVolume, exec, $wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, $wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
",XF86AudioMute, exec, $wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioMicMute, exec, $wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",XF86AudioPause, exec, ${getExe playerctl} play-pause"
",XF86AudioPlay, exec, ${getExe playerctl} play-pause"
",XF86AudioNext, exec, ${getExe playerctl} next"
",XF86AudioPrev, exec, ${getExe playerctl} previous"
# backlight
",XF86MonBrightnessUp, exec, ${getExe' light "light"} -A 5"
",XF86MonBrightnessDown, exec, ${getExe' light "light"} -U 5"
# screenshot
",Print, exec, ${getExe grimblast} --freeze save area - | ${getExe swappy} -f -"
]
++
# Switch workspaces with mod + [0-9]
# Move active window to a workspace with mod + SHIFT + [0-9]
lib.flatten (
builtins.map (
i:
let
key = builtins.elemAt keys (i - 1);
in
[ [
"$mod, Return, exec, ${getExe alacritty}" "$mod, ${key}, workspace, ${toString i}"
"$mod SHIFT, A, killactive," "$mod SHIFT, ${key}, movetoworkspace, ${toString i}"
"$mod SHIFT, E, exit,"
"$mod SHIFT, Space, togglefloating,"
"$mod, D, exec, ${getExe fuzzel}"
"$mod, F, fullscreen, 0"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
# audio
",XF86AudioRaiseVolume, exec, $wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, $wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
",XF86AudioMute, exec, $wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioMicMute, exec, $wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",XF86AudioPause, exec, ${getExe playerctl} play-pause"
",XF86AudioPlay, exec, ${getExe playerctl} play-pause"
",XF86AudioNext, exec, ${getExe playerctl} next"
",XF86AudioPrev, exec, ${getExe playerctl} previous"
# backlight
",XF86MonBrightnessUp, exec, ${getExe' light "light"} -A 5"
",XF86MonBrightnessDown, exec, ${getExe' light "light"} -U 5"
# screenshot
",Print, exec, ${getExe grimblast} --freeze save area - | ${getExe swappy} -f -"
] ]
++ ) (lib.range 1 10)
# Switch workspaces with mod + [0-9] );
# Move active window to a workspace with mod + SHIFT + [0-9]
lib.flatten (
builtins.map (
i:
let
key = builtins.elemAt keys (i - 1);
in
[
"$mod, ${key}, workspace, ${toString i}"
"$mod SHIFT, ${key}, movetoworkspace, ${toString i}"
]
) (lib.range 1 10)
);
bindm = [ bindm = [
"$mod, mouse:272, movewindow" "$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow" "$mod, mouse:273, resizewindow"
"$mod SHIFT, mouse:272, resizewindow" "$mod SHIFT, mouse:272, resizewindow"
]; ];
};
}; };
};
} }

View file

@ -1,7 +1,6 @@
# home-manager module { pkgs, ... }:
{ {
programs.neovide = { environment.systemPackages = [ pkgs.neovide ];
enable = true;
settings.fork = true; hj.".config/neovide/config.toml".text = "fork = true";
};
} }

View file

@ -8,8 +8,8 @@ let
toml = pkgs.formats.toml { }; toml = pkgs.formats.toml { };
in in
{ {
hm.home.file.".cargo/config.toml".source = toml.generate "config.toml" { hj.".cargo/config.toml".source = toml.generate "config.toml" {
build.target-dir = "${config.hm.home.homeDirectory}/.cargo/target"; build.target-dir = "${config.hjem.users.leo.directory}/.cargo/target";
target.x86_64-unknown-linux-gnu = { target.x86_64-unknown-linux-gnu = {
linker = "${lib.getExe pkgs.clang}"; linker = "${lib.getExe pkgs.clang}";

View file

@ -1,13 +1,24 @@
{ lib, pkgs, ... }:
let
toml = pkgs.formats.toml { };
in
{ {
hm.programs.starship = { environment.systemPackages = [ pkgs.starship ];
enable = true;
settings = {
add_newline = false;
directory = { hj = {
truncation_length = 3; ".config/starship.toml" =
truncation_symbol = "/"; toml.generate "starship.toml" {
}; add_newline = false;
} // (import ./nerd-font.nix);
directory = {
truncation_length = 3;
truncation_symbol = "/";
};
}
// (import ./nerd-font.nix);
".config/fish/config.fish".text = lib.mkAfter ''
starship init fish | source
'';
}; };
} }

View file

@ -5,93 +5,92 @@
... ...
}: }:
{ {
hm.programs.waybar = { environment.systemPackages = [ pkgs.waybar ];
enable = true;
style = ./style.css;
settings = [ hj = {
{ ".config/waybar/style.css".source = ./style.css;
position = "bottom";
layer = "top";
height = 24;
spacing = 2;
modules-left = [ "hyprland/workspaces" ]; ".config/waybar/config".text = builtins.toJSON {
modules-center = [ ]; position = "bottom";
modules-right = layer = "top";
[ "memory" ] height = 24;
++ lib.optionals (builtins.elem "amdgpu" config.services.xserver.videoDrivers) [ spacing = 2;
"custom/gpu-usage"
]
++ [
"cpu"
"wireplumber"
]
++ lib.optionals config.services.power-profiles-daemon.enable [ "battery" ]
++ lib.optionals config.programs.light.enable [ "backlight" ]
++ [
"clock"
"tray"
];
"hyprland/workspaces" = { modules-left = [ "hyprland/workspaces" ];
format = "{name}"; modules-center = [ ];
on-click = "activate"; modules-right =
sort-by-number = true; [ "memory" ]
++ lib.optionals (builtins.elem "amdgpu" config.services.xserver.videoDrivers) [
"custom/gpu-usage"
]
++ [
"cpu"
"wireplumber"
]
++ lib.optionals config.services.power-profiles-daemon.enable [ "battery" ]
++ lib.optionals config.programs.light.enable [ "backlight" ]
++ [
"clock"
"tray"
];
"hyprland/workspaces" = {
format = "{name}";
on-click = "activate";
sort-by-number = true;
};
tray = {
icon-size = 16;
spacing = 10;
};
clock = {
format-alt = "{:%Y-%m-%d %H:%M:%S}";
interval = 1;
};
cpu = {
format = "CPU {usage}%";
tooltip = false;
interval = 2;
};
memory = {
format = "RAM {}%";
interval = 2;
};
backlight = {
format = "LGT {percent}%";
scroll-step = 5;
};
battery = {
states = {
low = 15;
}; };
format = "BAT {capacity}%";
format-charging = "BAT+ {capacity}%";
format-plugged = "BAT+ {capacity}%";
format-low = "BAT! {capacity}%";
interval = 5;
};
tray = { wireplumber = {
icon-size = 16; scroll-step = 5;
spacing = 10; format = "VOL {volume}%";
}; format-muted = "muted";
on-click = "${lib.getExe' pkgs.wireplumber "wpctl"} set-mute @DEFAULT_AUDIO_SINK@ toggle";
on-click-right = "${lib.getExe pkgs.pavucontrol}";
};
clock = { "custom/gpu-usage" = {
format-alt = "{:%Y-%m-%d %H:%M:%S}"; exec = "cat /sys/class/hwmon/hwmon*/device/gpu_busy_percent";
interval = 1; format = "GPU {}%";
}; return-type = "";
interval = 2;
cpu = { };
format = "CPU {usage}%"; };
tooltip = false;
interval = 2;
};
memory = {
format = "RAM {}%";
interval = 2;
};
backlight = {
format = "LGT {percent}%";
scroll-step = 5;
};
battery = {
states = {
low = 15;
};
format = "BAT {capacity}%";
format-charging = "BAT+ {capacity}%";
format-plugged = "BAT+ {capacity}%";
format-low = "BAT! {capacity}%";
interval = 5;
};
wireplumber = {
scroll-step = 5;
format = "VOL {volume}%";
format-muted = "muted";
on-click = "${lib.getExe' pkgs.wireplumber "wpctl"} set-mute @DEFAULT_AUDIO_SINK@ toggle";
on-click-right = "${lib.getExe pkgs.pavucontrol}";
};
"custom/gpu-usage" = {
exec = "cat /sys/class/hwmon/hwmon*/device/gpu_busy_percent";
format = "GPU {}%";
return-type = "";
interval = 2;
};
}
];
}; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, _utils, ... }:
{ {
imports = [ imports = [
./nvidia.nix ./nvidia.nix
@ -7,20 +7,16 @@
services.xserver.videoDrivers = [ "amdgpu" ]; services.xserver.videoDrivers = [ "amdgpu" ];
hm = { environment.systemPackages = with pkgs; [
home.packages = with pkgs; [ wineWowPackages.waylandFull
wineWowPackages.waylandFull ];
hj.".config/hypr/hyprland.conf".text = _utils.toHyprconf {
monitor = "DP-1,3840x2160@144,0x0,1.5";
xwayland.force_zero_scaling = true;
env = [
"GDK_SCALE,1.5"
"XCURSOR_SIZE,24"
]; ];
wayland.windowManager.hyprland.settings = {
monitor = "DP-1,3840x2160@144,0x0,1.5";
xwayland.force_zero_scaling = true;
env = [
"GDK_SCALE,1.5"
"XCURSOR_SIZE,24"
];
};
}; };
} }

View file

@ -2,6 +2,7 @@
lib, lib,
pkgs, pkgs,
config, config,
_utils,
... ...
}: }:
{ {
@ -37,10 +38,12 @@
}; };
}; };
hm.wayland.windowManager.hyprland.settings.env = [ hj.".config/hypr/hyprland.conf".text = _utils.toHyprconf {
"XDG_SESSION_TYPE,wayland" env = [
"GBM_BACKEND,nvidia-drm" "XDG_SESSION_TYPE,wayland"
"__GLX_VENDOR_LIBRARY_NAME,nvidia" "GBM_BACKEND,nvidia-drm"
"NVD_BACKEND,direct" "__GLX_VENDOR_LIBRARY_NAME,nvidia"
]; "NVD_BACKEND,direct"
];
};
} }

View file

@ -29,9 +29,14 @@ in
i18n.defaultLocale = lib.mkForce "fr_FR.UTF-8"; i18n.defaultLocale = lib.mkForce "fr_FR.UTF-8";
hm.programs = { hj = {
git.includes = [ { path = "~/.config/git/work_config"; } ]; ".gitconfig".text = lib.generators.toGitINI {
ssh.includes = [ "work_config" ]; include.path = "~/.config/git/work_config";
};
".ssh/config".text = lib.mkBefore ''
Include work_config
'';
}; };
networking.firewall.allowedTCPPorts = [ 8000 ]; networking.firewall.allowedTCPPorts = [ 8000 ];