This commit is contained in:
Ray Andrew 2024-11-03 15:27:57 -06:00
parent 3a32e50429
commit b2cf19f883
64 changed files with 885 additions and 445 deletions

3
.gitignore vendored
View file

@ -1 +1,4 @@
*.swp *.swp
# Generated by nix-pre-commit-hooks
/.pre-commit-config.yaml

View file

@ -87,6 +87,22 @@
} }
}, },
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1673956053, "lastModified": 1673956053,
@ -139,6 +155,50 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1730302582,
"narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gnome-shell": { "gnome-shell": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -265,6 +325,22 @@
} }
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": {
"lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1729691686, "lastModified": 1729691686,
"narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=", "narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=",
@ -306,14 +382,16 @@
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"git-hooks": "git-hooks",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable_2",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"stylix": "stylix" "stylix": "stylix",
"treefmt-nix": "treefmt-nix"
} }
}, },
"stylix": { "stylix": {
@ -322,7 +400,7 @@
"base16-fish": "base16-fish", "base16-fish": "base16-fish",
"base16-helix": "base16-helix", "base16-helix": "base16-helix",
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"flake-compat": "flake-compat", "flake-compat": "flake-compat_2",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
@ -411,6 +489,26 @@
"repo": "tinted-tmux", "repo": "tinted-tmux",
"type": "github" "type": "github"
} }
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1730321837,
"narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "746901bb8dba96d154b66492a29f5db0693dbfcc",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -17,10 +17,19 @@
plasma-manager.url = "github:nix-community/plasma-manager"; plasma-manager.url = "github:nix-community/plasma-manager";
plasma-manager.inputs.nixpkgs.follows = "nixpkgs"; plasma-manager.inputs.nixpkgs.follows = "nixpkgs";
plasma-manager.inputs.home-manager.follows = "home-manager"; plasma-manager.inputs.home-manager.follows = "home-manager";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = outputs =
inputs@{ nixpkgs, self, ... }: inputs@{
nixpkgs,
self,
treefmt-nix,
...
}:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
@ -55,9 +64,65 @@
"x86_64-darwin" "x86_64-darwin"
"aarch64-darwin" "aarch64-darwin"
] (system: fn (createCommonArgs system)); ] (system: fn (createCommonArgs system));
treefmtEval = forAllSystems (
{ pkgs, ... }:
treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs.nixfmt-rfc-style.enable = true;
settings.global.excludes = [ "flake.lock" ];
}
);
in in
{ {
inherit lib self; inherit lib self;
nixosConfigurations = (import ./src/hosts/default.nix commonArgs); nixosConfigurations = import ./src/hosts/default.nix commonArgs;
checks = forAllSystems (
{
pkgs,
system,
...
}:
{
formatting = treefmtEval.${system}.config.build.check self;
pre-commit-check = inputs.git-hooks.lib.${system}.run {
src = ./.;
excludes = [ "flake.lock" ];
hooks = {
treefmt = {
enable = true;
package = lib.mkOverride 900 treefmtEval.${system}.config.build.wrapper;
};
};
};
}
);
devShells = forAllSystems (
{
pkgs,
system,
...
}:
{
default = pkgs.mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
name = "dotfiles";
buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
nativeBuildInputs = [
treefmtEval.${system}.config.build.wrapper
];
packages = [
pkgs.sops
pkgs.ssh-to-age
pkgs.nixfmt-rfc-style
];
DIRENV_LOG_FORMAT = "";
};
}
);
formatter = forAllSystems ({ system, ... }: treefmtEval.${system}.config.build.wrapper);
}; };
} }

View file

@ -5,12 +5,10 @@
user, user,
... ...
}: }:
{ {
imports = [ imports = [
./emacs.nix ./emacs.nix
./impermanence.nix ./impermanence.nix
./git.nix
./gui ./gui
./latex.nix ./latex.nix
./shell ./shell
@ -20,7 +18,6 @@
]; ];
config = { config = {
# setup fonts for other distros, run "fc-cache -f" to refresh fonts # setup fonts for other distros, run "fc-cache -f" to refresh fonts
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
@ -60,7 +57,6 @@
# ''; # '';
# }; # };
}; };
}; };
programs.home-manager.enable = true; programs.home-manager.enable = true;
@ -71,7 +67,8 @@
userDirs = userDirs =
let let
homeDir = config.home.homeDirectory; homeDir = config.home.homeDirectory;
in { in
{
enable = true; enable = true;
download = "${homeDir}/downloads"; download = "${homeDir}/downloads";
documents = "${homeDir}/documents"; documents = "${homeDir}/documents";

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.emacs = { programs.emacs = {
enable = true; enable = true;

View file

@ -1,5 +1,8 @@
{ config, pkgs, ... }: {
config,
pkgs,
...
}:
{ {
custom.persist = { custom.persist = {
home.directories = [ home.directories = [

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.chromium = { programs.chromium = {
enable = true; enable = true;

View file

@ -1,5 +1,8 @@
{ pkgs, config, ... }: {
pkgs,
config,
...
}:
{ {
imports = [ imports = [
./1password.nix ./1password.nix
@ -39,7 +42,6 @@
}; };
}; };
qt = { qt = {
enable = true; enable = true;
# platformTheme.name = "adwaita"; # platformTheme.name = "adwaita";

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
discord discord

View file

@ -1,5 +1,10 @@
{ config, pkgs, lib, user, ... }: {
config,
pkgs,
lib,
user,
...
}:
let let
vendorPath = ".config/.mozilla"; vendorPath = ".config/.mozilla";
configPath = "${vendorPath}/firefox"; configPath = "${vendorPath}/firefox";
@ -14,13 +19,11 @@ in
wrapProgram "$executablePath" \ wrapProgram "$executablePath" \
--set 'HOME' '${config.xdg.configHome}' \ --set 'HOME' '${config.xdg.configHome}' \
--append-flags "${ --append-flags "${
lib.concatStringsSep " " ( lib.concatStringsSep " " [
[
"--name firefox" "--name firefox"
"-P ${user}" "-P ${user}"
# "--profile ${config.xdg.configHome}/.mozilla/${user}" # "--profile ${config.xdg.configHome}/.mozilla/${user}"
] ]
)
}" }"
''; '';
}); });

View file

@ -1,5 +1,8 @@
{ pkgs, config, ... }: {
pkgs,
config,
...
}:
{ {
programs.foot = { programs.foot = {
enable = true; enable = true;

View file

@ -1,5 +1,9 @@
{ lib, pkgs, config, ... }: {
lib,
pkgs,
config,
...
}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
pop-launcher pop-launcher
@ -45,7 +49,10 @@
move-to-monitor-right = [ ]; move-to-monitor-right = [ ];
move-to-workspace-down = [ ]; move-to-workspace-down = [ ];
move-to-workspace-up = [ ]; move-to-workspace-up = [ ];
close = [ "<Super><Shift>q" "<Alt>F4" ]; close = [
"<Super><Shift>q"
"<Alt>F4"
];
switch-to-workspace-1 = [ "<Super>1" ]; switch-to-workspace-1 = [ "<Super>1" ];
switch-to-workspace-2 = [ "<Super>2" ]; switch-to-workspace-2 = [ "<Super>2" ];
switch-to-workspace-3 = [ "<Super>3" ]; switch-to-workspace-3 = [ "<Super>3" ];
@ -78,7 +85,10 @@
switch-to-application-7 = [ ]; switch-to-application-7 = [ ];
switch-to-application-8 = [ ]; switch-to-application-8 = [ ];
switch-to-application-9 = [ ]; switch-to-application-9 = [ ];
show-screenshot-ui = [ "Print" "<Super>o" ]; show-screenshot-ui = [
"Print"
"<Super>o"
];
}; };
"org/gnome/settings-daemon/plugins/media-keys" = { "org/gnome/settings-daemon/plugins/media-keys" = {
video-out = [ ]; video-out = [ ];

View file

@ -1,5 +1,9 @@
{ pkgs, config, lib, ... }: {
pkgs,
config,
lib,
...
}:
let let
bar = { bar = {
position = "bottom"; position = "bottom";
@ -35,10 +39,12 @@ in
blocks = [ blocks = [
{ {
block = "sound"; block = "sound";
click = [{ click = [
{
button = "left"; button = "left";
cmd = lib.getExe' pkgs.pwvucontrol "pwvucontrol"; cmd = lib.getExe' pkgs.pwvucontrol "pwvucontrol";
}]; }
];
} }
{ {
block = "net"; block = "net";

View file

@ -1,5 +1,11 @@
{ inputs, lib, pkgs, config, stdenv, ... }: {
inputs,
lib,
pkgs,
config,
stdenv,
...
}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
kdePackages.krohnkite kdePackages.krohnkite
@ -83,4 +89,3 @@
}; };
}; };
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
xdg.configFile."keyd/app.conf" = { xdg.configFile."keyd/app.conf" = {
text = '' text = ''

View file

@ -1,5 +1,8 @@
{ pkgs, config, ... }: {
pkgs,
config,
...
}:
{ {
programs.kitty = { programs.kitty = {
enable = true; enable = true;

View file

@ -1,5 +1,8 @@
{ config, pkgs, ... }: {
config,
pkgs,
...
}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
skypeforlinux skypeforlinux

View file

@ -1,5 +1,8 @@
{ config, pkgs, ... }: {
config,
pkgs,
...
}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
slack slack

View file

@ -1,5 +1,8 @@
{ pkgs, config, ... }: {
pkgs,
config,
...
}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
spotify spotify
@ -11,4 +14,3 @@
]; ];
}; };
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
teams-for-linux teams-for-linux

View file

@ -1,5 +1,8 @@
{ config, pkgs, ... }: {
config,
pkgs,
...
}:
{ {
programs.vscode = { programs.vscode = {
enable = true; enable = true;

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.wezterm = { programs.wezterm = {
enable = true; enable = true;

View file

@ -1,8 +1,5 @@
_: _: {
{
programs.zathura = { programs.zathura = {
enable = true; enable = true;
}; };
} }

View file

@ -1,12 +1,18 @@
{ config, pkgs, ... }: {
config,
pkgs,
...
}:
let let
zoom = pkgs.zoom-us.overrideAttrs (attrs: { zoom = pkgs.zoom-us.overrideAttrs (attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [ pkgs.bbe ]; nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [ pkgs.bbe ];
postFixup = '' postFixup =
''
cp $out/opt/zoom/zoom . cp $out/opt/zoom/zoom .
bbe -e 's/\0manjaro\0/\0nixos\0\0\0/' < zoom > $out/opt/zoom/zoom bbe -e 's/\0manjaro\0/\0nixos\0\0\0/' < zoom > $out/opt/zoom/zoom
'' + (attrs.postFixup or "") + '' ''
+ (attrs.postFixup or "")
+ ''
sed -i 's|Exec=|Exec=env XDG_CURRENT_DESKTOP="gnome" |' $out/share/applications/Zoom.desktop sed -i 's|Exec=|Exec=env XDG_CURRENT_DESKTOP="gnome" |' $out/share/applications/Zoom.desktop
''; '';
}); });

View file

@ -1,8 +1,12 @@
# note: this file exists just to define options for home-manager, # note: this file exists just to define options for home-manager,
# impermanence is not actually used in standalone home-manager as # impermanence is not actually used in standalone home-manager as
# it doesn't serve much utility on legacy distros # it doesn't serve much utility on legacy distros
{ lib, user, config, ... }: {
lib,
user,
config,
...
}:
let let
cfg = config.custom.persist; cfg = config.custom.persist;
in in

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
texlive.combined.scheme-full texlive.combined.scheme-full

View file

@ -1,5 +1,9 @@
{ lib, pkgs, config, ... }: {
lib,
pkgs,
config,
...
}:
{ {
programs.bash.enable = true; programs.bash.enable = true;
programs.bash.enableVteIntegration = true; programs.bash.enableVteIntegration = true;

View file

@ -1,14 +1,63 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
imports = [ imports = [
./bash.nix ./bash.nix
./direnv.nix ./direnv.nix
./fzf.nix ./git.nix
./lazygit.nix ./lazygit.nix
./nix.nix
./ripgrep.nix ./ripgrep.nix
./shell.nix ./shell.nix
./tmux ./tmux
./zoxide.nix ./zoxide.nix
]; ];
config = {
home.packages =
with pkgs;
[
fd
fx
jq
sd
ugrep
]
++ (lib.attrValues config.custom.shell.packages);
programs = {
bat = {
enable = true;
extraPackages = [
(pkgs.symlinkJoin {
name = "batman";
paths = [ pkgs.bat-extras.batman ];
postBuild = ''
mkdir -p $out/share/bash-completion/completions
echo 'complete -F _comp_cmd_man batman' > $out/share/bash-completion/completions/batman
mkdir -p $out/share/fish/vendor_completions.d
echo 'complete batman --wraps man' > $out/share/fish/vendor_completions.d/batman.fish
mkdir -p $out/share/zsh/site-functions
cat << EOF > $out/share/zsh/site-functions/_batman
#compdef batman
_man "$@"
EOF
'';
meta.mainProgram = "batman";
})
];
};
fzf = {
enable = true;
enableBashIntegration = config.programs.bash.enable;
enableFishIntegration = config.programs.fish.enable;
};
};
};
} }

View file

@ -1,8 +0,0 @@
{ config, ... }:
{
programs.fzf = {
enable = true;
enableBashIntegration = config.programs.bash.enable;
};
}

View file

@ -1,5 +1,9 @@
{ lib, pkgs, config, ... }: {
lib,
pkgs,
config,
...
}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
git git

View file

@ -1,11 +1,11 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.lazygit = { programs.lazygit = {
enable = true; enable = true;
settings = { settings = {
reporting = "off"; reporting = "off";
startupPopupVersion = 1; # startupPopupVersion = 1;
disableStartupPopups = true;
}; };
}; };
} }

46
src/home/shell/nix.nix Normal file
View file

@ -0,0 +1,46 @@
{
pkgs,
lib,
...
}:
let
nixpkgs-review = pkgs.nixpkgs-review.override { withNom = true; };
in
{
home = {
packages = with pkgs; [
nh
nixd
nix-output-monitor
nix-tree
nixpkgs-review
nvfetcher
];
shellAliases = {
nfl = "nix flake lock";
nfu = "nix flake update";
nfui = "nix flake lock --update-input";
nsh = "nix-shell --command fish -p";
nshp = "nix-shell --pure --command fish -p";
};
};
custom.shell.packages = {
# outputs the current nixos generation
nix-current-generation = ''
# previous desktop versions: 1196
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | grep current | awk '{print $1}'
'';
};
programs = {
nix-index.enable = true;
};
custom.persist = {
home = {
cache.directories = [ ".cache/nix-index" ];
};
};
}

View file

@ -1,5 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
shell = { shell = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
tmux tmux

View file

@ -1,5 +1,4 @@
{ config, ... }: { config, ... }:
{ {
home.shellAliases = { home.shellAliases = {
z = "zoxide query -i"; z = "zoxide query -i";

View file

@ -1,5 +1,8 @@
{ config, pkgs, ... }: {
config,
pkgs,
...
}:
{ {
programs.ssh = { programs.ssh = {
enable = false; enable = false;

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
vim-full vim-full

View file

@ -1,5 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
wm = { wm = {

View file

@ -1,18 +1,19 @@
{ config {
, pkgs config,
, lib pkgs,
, menu lib,
, terminal menu,
, light ? lib.getExe' pkgs.brightnessctl "brightnessctl" terminal,
, playerctl ? lib.getExe' pkgs.playerctl "playerctl" light ? lib.getExe' pkgs.brightnessctl "brightnessctl",
, sound ? "pactl" playerctl ? lib.getExe' pkgs.playerctl "playerctl",
, alt ? "Mod1" sound ? "pactl",
, modifier ? "Mod4" alt ? "Mod1",
, extraWindowOptions ? { } modifier ? "Mod4",
, extraFocusOptions ? { } extraWindowOptions ? { },
, extraModes ? { } extraFocusOptions ? { },
, extraConfig ? "" extraModes ? { },
, workspaces ? [ extraConfig ? "",
workspaces ? [
{ {
ws = 1; ws = 1;
name = "1"; name = "1";
@ -53,17 +54,24 @@
ws = 0; ws = 0;
name = "10"; name = "10";
} }
] ],
, ... ...
}: }:
let let
powerManagementMode = " : Screen [l]ock, [e]xit, [s]uspend, [h]ibernate, [R]eboot, [S]hutdown"; powerManagementMode = " : Screen [l]ock, [e]xit, [s]uspend, [h]ibernate, [R]eboot, [S]hutdown";
resizeMode = " : [h] , [j] , [k] , [l] "; resizeMode = " : [h] , [j] , [k] , [l] ";
# Helpers # Helpers
mapDirection = { prefixKey ? null, leftCmd, downCmd, upCmd, rightCmd }: mapDirection =
with lib.strings; { {
prefixKey ? null,
leftCmd,
downCmd,
upCmd,
rightCmd,
}:
with lib.strings;
{
# Arrow keys # Arrow keys
"${optionalString (prefixKey != null) "${prefixKey}+"}Left" = leftCmd; "${optionalString (prefixKey != null) "${prefixKey}+"}Left" = leftCmd;
"${optionalString (prefixKey != null) "${prefixKey}+"}Down" = downCmd; "${optionalString (prefixKey != null) "${prefixKey}+"}Down" = downCmd;
@ -76,7 +84,11 @@ let
"${optionalString (prefixKey != null) "${prefixKey}+"}l" = rightCmd; "${optionalString (prefixKey != null) "${prefixKey}+"}l" = rightCmd;
}; };
mapDirectionDefault = { prefixKey ? null, prefixCmd }: mapDirectionDefault =
{
prefixKey ? null,
prefixCmd,
}:
(mapDirection { (mapDirection {
inherit prefixKey; inherit prefixKey;
leftCmd = "${prefixCmd} left"; leftCmd = "${prefixCmd} left";
@ -85,21 +97,32 @@ let
rightCmd = "${prefixCmd} right"; rightCmd = "${prefixCmd} right";
}); });
mapWorkspacesStr = with builtins; mapWorkspacesStr =
with builtins;
with lib.strings; with lib.strings;
{ workspaces, prefixKey ? null, prefixCmd }: {
(concatStringsSep "\n" (map workspaces,
({ ws, name }: prefixKey ? null,
'' prefixCmd,
bindsym ${optionalString (prefixKey != null) "${prefixKey}+"}${ }:
toString ws (concatStringsSep "\n" (
} ${prefixCmd} "${name}"'') map (
workspaces)); {
ws,
name,
}:
''bindsym ${
optionalString (prefixKey != null) "${prefixKey}+"
}${toString ws} ${prefixCmd} "${name}"''
) workspaces
));
in in
{ {
inherit modifier terminal; inherit modifier terminal;
helpers = { inherit mapDirection mapDirectionDefault mapWorkspacesStr; }; helpers = {
inherit mapDirection mapDirectionDefault mapWorkspacesStr;
};
config = { config = {
inherit modifier terminal; inherit modifier terminal;
@ -116,7 +139,7 @@ in
"${modifier}+Shift+c" = "reload"; "${modifier}+Shift+c" = "reload";
"${modifier}+Shift+r" = "restart"; "${modifier}+Shift+r" = "restart";
"${modifier}+Shift+q" = "kill"; "${modifier}+Shift+q" = "kill";
"${modifier}+Shift+e" = "exit"; # "${modifier}+Shift+e" = "exit";
"${alt}+F4" = "kill"; "${alt}+F4" = "kill";
"${modifier}+h" = "focus left"; "${modifier}+h" = "focus left";
@ -157,12 +180,14 @@ in
}; };
in in
{ {
${resizeMode} = (mapDirection { ${resizeMode} =
(mapDirection {
leftCmd = "resize shrink width 10px or 10ppt"; leftCmd = "resize shrink width 10px or 10ppt";
downCmd = "resize grow height 10px or 10ppt"; downCmd = "resize grow height 10px or 10ppt";
upCmd = "resize shrink height 10px or 10ppt"; upCmd = "resize shrink height 10px or 10ppt";
rightCmd = "resize grow width 10px or 10ppt"; rightCmd = "resize grow width 10px or 10ppt";
}) // exitMode; })
// exitMode;
${powerManagementMode} = { ${powerManagementMode} = {
l = "mode default, exec loginctl lock-session"; l = "mode default, exec loginctl lock-session";
e = "mode default, exec loginctl terminate-session $XDG_SESSION_ID"; e = "mode default, exec loginctl terminate-session $XDG_SESSION_ID";
@ -171,7 +196,8 @@ in
"Shift+r" = "mode default, exec systemctl reboot"; "Shift+r" = "mode default, exec systemctl reboot";
"Shift+s" = "mode default, exec systemctl poweroff"; "Shift+s" = "mode default, exec systemctl poweroff";
} // exitMode; } // exitMode;
} // extraModes; }
// extraModes;
workspaceAutoBackAndForth = true; workspaceAutoBackAndForth = true;
workspaceLayout = "tabbed"; workspaceLayout = "tabbed";
@ -182,14 +208,16 @@ in
titlebar = false; titlebar = false;
} // extraWindowOptions; } // extraWindowOptions;
focus = { followMouse = false; } // extraFocusOptions; focus = {
followMouse = false;
} // extraFocusOptions;
}; };
# Until this issue is fixed we need to map workspaces directly to config file # Until this issue is fixed we need to map workspaces directly to config file
# https://github.com/nix-community/home-manager/issues/695 # https://github.com/nix-community/home-manager/issues/695
extraConfig = extraConfig =
let let
workspaceStr = (builtins.concatStringsSep "\n" [ workspaceStr = builtins.concatStringsSep "\n" [
(mapWorkspacesStr { (mapWorkspacesStr {
inherit workspaces; inherit workspaces;
prefixKey = modifier; prefixKey = modifier;
@ -200,7 +228,7 @@ in
prefixKey = "${modifier}+Shift"; prefixKey = "${modifier}+Shift";
prefixCmd = "move container to workspace number"; prefixCmd = "move container to workspace number";
}) })
]); ];
in in
'' ''
${workspaceStr} ${workspaceStr}

View file

@ -1,6 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
let let
pactl = lib.getExe' pkgs.pulseaudio "pactl"; pactl = lib.getExe' pkgs.pulseaudio "pactl";
maim = lib.getExe' pkgs.maim "maim"; maim = lib.getExe' pkgs.maim "maim";
@ -31,12 +34,13 @@ in
xsession.windowManager.i3 = { xsession.windowManager.i3 = {
enable = true; enable = true;
extraConfig = commonOptions.extraConfig; extraConfig = commonOptions.extraConfig;
config = lib.mkMerge ([ config = lib.mkMerge [
commonOptions.config commonOptions.config
{ {
# modifier = "Mod4"; # modifier = "Mod4";
# terminal = "kitty"; # terminal = "kitty";
keybindings = { keybindings = {
"${commonOptions.modifier}+Shift+e" = "exec \"i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'\"";
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +1%"; "XF86AudioRaiseVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +1%";
"XF86AudioLowerVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -1%"; "XF86AudioLowerVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -1%";
"XF86AudioMute" = "exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMute" = "exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
@ -46,7 +50,7 @@ in
"PRINT" = "exec --no-startup-id ${maim} -s | ${clipboard-copy} -selection clipboard -t image/png"; "PRINT" = "exec --no-startup-id ${maim} -s | ${clipboard-copy} -selection clipboard -t image/png";
}; };
} }
]); ];
}; };
stylix.targets.i3.enable = true; stylix.targets.i3.enable = true;
}; };

View file

@ -1,5 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
let let
swayosd = lib.getExe' config.services.swayosd.package "swayosd-client"; swayosd = lib.getExe' config.services.swayosd.package "swayosd-client";
pactl = lib.getExe' pkgs.pulseaudio "pactl"; pactl = lib.getExe' pkgs.pulseaudio "pactl";
@ -32,10 +36,11 @@ in
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
extraConfig = commonOptions.extraConfig; extraConfig = commonOptions.extraConfig;
config = lib.mkMerge ([ config = lib.mkMerge [
commonOptions.config commonOptions.config
{ {
keybindings = { keybindings = {
"${commonOptions.modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'";
"XF86AudioRaiseVolume" = "exec --no-startup-id '${swayosd} --output-volume=raise'"; "XF86AudioRaiseVolume" = "exec --no-startup-id '${swayosd} --output-volume=raise'";
"XF86AudioLowerVolume" = "exec --no-startup-id '${swayosd} --output-volume=lower'"; "XF86AudioLowerVolume" = "exec --no-startup-id '${swayosd} --output-volume=lower'";
"XF86AudioMute" = "exec --no-startup-id '${swayosd} --output-volume=mute-toggle"; "XF86AudioMute" = "exec --no-startup-id '${swayosd} --output-volume=mute-toggle";
@ -45,7 +50,7 @@ in
"PRINT" = "exec --no-startup-id ${grim} -g \"\$(${slurp})\" -t png - | ${clipboard-copy}"; "PRINT" = "exec --no-startup-id ${grim} -g \"\$(${slurp})\" -t png - | ${clipboard-copy}";
}; };
} }
]); ];
}; };
stylix.targets.sway.enable = true; stylix.targets.sway.enable = true;
}; };

View file

@ -1,5 +1,11 @@
{ config, lib, pkgs, inputs, user, ... }: {
config,
lib,
pkgs,
inputs,
user,
...
}:
{ {
imports = [ ]; imports = [ ];
@ -54,4 +60,3 @@
system.stateVersion = "24.11"; system.stateVersion = "24.11";
} }

View file

@ -47,7 +47,10 @@
"defaults" "defaults"
"umask=0077" "umask=0077"
]; ];
extraArgs = [ "-n" "BOOT" ]; extraArgs = [
"-n"
"BOOT"
];
}; };
}; };
swap = { swap = {
@ -56,7 +59,10 @@
type = "swap"; type = "swap";
discardPolicy = "both"; discardPolicy = "both";
resumeDevice = true; resumeDevice = true;
extraArgs = [ "--label" "SWAP" ]; extraArgs = [
"--label"
"SWAP"
];
}; };
}; };
zfs = { zfs = {

View file

@ -1,8 +1,14 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ inputs, config, lib, pkgs, modulesPath, ... }: {
inputs,
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
@ -10,7 +16,14 @@
inputs.nixos-hardware.nixosModules.framework-13-7040-amd inputs.nixos-hardware.nixosModules.framework-13-7040-amd
]; ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View file

@ -1,5 +1,10 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
inputs,
lib,
...
}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
fw-ectool fw-ectool

View file

@ -1,6 +1,10 @@
{ lib, pkgs, ... }: {
lib,
lib.extend (_: libprev: { pkgs,
...
}:
lib.extend (
_: libprev: {
custom = rec { custom = rec {
# taken from https://github.com/iynaix/dotfiles/blob/main/lib.nix # taken from https://github.com/iynaix/dotfiles/blob/main/lib.nix
# writeShellApplication with support for completions # writeShellApplication with support for completions
@ -59,4 +63,5 @@ lib.extend (_: libprev: {
writeShellApplicationCompletions (value // { inherit name; }) writeShellApplicationCompletions (value // { inherit name; })
); );
}; };
}) }
)

View file

@ -1,5 +1,9 @@
{ config, pkgs, user, ... }: {
config,
pkgs,
user,
...
}:
{ {
programs._1password.enable = true; programs._1password.enable = true;
programs._1password-gui = { programs._1password-gui = {

View file

@ -1,5 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
bluetooth = { bluetooth = {

View file

@ -4,7 +4,6 @@
pkgs, pkgs,
... ...
}: }:
{ {
imports = [ imports = [
./1password.nix ./1password.nix
@ -62,7 +61,9 @@
config = { config = {
environment = { environment = {
systemPackages = with pkgs; [ systemPackages =
with pkgs;
[
curl curl
eza eza
neovim neovim
@ -73,7 +74,8 @@
wget wget
htop-vim htop-vim
keyd keyd
] ++ (lib.attrValues config.custom.shell.packages); ]
++ (lib.attrValues config.custom.shell.packages);
}; };
}; };
} }

View file

@ -1,5 +1,4 @@
{ config, ... }: { config, ... }:
{ {
services = { services = {
xserver = { xserver = {
@ -26,4 +25,10 @@
}; };
security.polkit.enable = true; security.polkit.enable = true;
custom.persist = {
root.directories = [
"/var/lib/AccountsService/users"
];
};
} }

View file

@ -1,5 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
fingerprint = { fingerprint = {
@ -11,6 +15,7 @@
services.fprintd.enable = true; services.fprintd.enable = true;
security.pam.services.login.fprintAuth = false; security.pam.services.login.fprintAuth = false;
security.pam.services.sudo.fprintAuth = false; security.pam.services.sudo.fprintAuth = false;
security.pam.services.i3lock.fprintAuth = false;
custom.persist = { custom.persist = {
root.directories = [ root.directories = [
"/var/lib/fprint" "/var/lib/fprint"

View file

@ -1,5 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
nerdfonts = { nerdfonts = {

View file

@ -1,5 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
gnome = { gnome = {
@ -19,7 +23,6 @@
cheese cheese
epiphany epiphany
simple-scan simple-scan
yelp
evince evince
geary geary
gnome-tour gnome-tour
@ -27,6 +30,12 @@
gnome-music gnome-music
gnome-maps gnome-maps
gnome-disk-utility gnome-disk-utility
gnome-characters
tali # poker game
iagno # go game
hitori # sudoku game
atomix # puzzle game
yelp # Help view
]; ];
}) })
{ {

View file

@ -1,5 +1,9 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
kde = { kde = {

View file

@ -1,5 +1,8 @@
{ config, lib, ... }: {
config,
lib,
...
}:
let let
commonSettings = { commonSettings = {
main = { main = {
@ -24,7 +27,7 @@ in
}; };
framework = { framework = {
ids = [ "0001:0001:a38e6885" ]; ids = [ "0001:0001:a38e6885" ];
settings = lib.mkMerge ([ settings = lib.mkMerge [
commonSettings commonSettings
{ {
main = { main = {
@ -32,11 +35,11 @@ in
leftmeta = "layer(alt)"; leftmeta = "layer(alt)";
}; };
} }
]); ];
}; };
normal = { normal = {
ids = [ "413c:2107:eb8bfad1" ]; ids = [ "413c:2107:eb8bfad1" ];
settings = lib.mkMerge ([ settings = lib.mkMerge [
commonSettings commonSettings
{ {
main = { main = {
@ -44,7 +47,7 @@ in
leftmeta = "layer(alt)"; leftmeta = "layer(alt)";
}; };
} }
]); ];
}; };
}; };
}; };

View file

@ -37,8 +37,7 @@ in
"D! /nix/var/nix/profiles/per-user/root 1755 root root 1d" "D! /nix/var/nix/profiles/per-user/root 1755 root root 1d"
]; ];
custom.shell.packages = custom.shell.packages = {
{
# list all installed packages # list all installed packages
nix-list-packages = { nix-list-packages = {
text = text =

View file

@ -1,5 +1,8 @@
{ pkgs, config, ... }: {
pkgs,
config,
...
}:
{ {
stylix = { stylix = {
enable = true; enable = true;

View file

@ -1,7 +1,10 @@
{ pkgs, lib, config, ... }:
{ {
pkgs,
lib,
config,
...
}:
{
options.custom = with lib; { options.custom = with lib; {
touchpad = { touchpad = {
enable = mkEnableOption "Enable touchpad"; enable = mkEnableOption "Enable touchpad";

View file

@ -4,7 +4,6 @@
user, user,
... ...
}: }:
{ {
config = lib.mkMerge [ config = lib.mkMerge [
{ {

View file

@ -1,5 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
wm = { wm = {
@ -20,10 +24,12 @@
dmenu dmenu
i3status i3status
i3lock i3lock
i3blocks
]; ];
}; };
}; };
programs.xss-lock = {
enable = true;
};
hm.custom.wm.i3.enable = true; hm.custom.wm.i3.enable = true;
hm.custom.i3status-rust.enable = true; hm.custom.i3status-rust.enable = true;
}; };

View file

@ -1,5 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
{ {
options.custom = with lib; { options.custom = with lib; {
wm = { wm = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
xdg.portal = { xdg.portal = {
enable = true; enable = true;

View file

@ -1,5 +1,9 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
boot.supportedFilesystems.zfs = true; boot.supportedFilesystems.zfs = true;
boot.zfs = { boot.zfs = {