Compare commits
1 Commits
main
...
xps16-btbr
Author | SHA1 | Date | |
---|---|---|---|
68b8da0c8f |
README.mdflake.lockflake.nix
home
config
home.nixmodules
packages.nixprograms
anyrun
browser
firefox.nixgdb.nixgit
gpg.nixhyprland.nixhyprland
default.nixhypridle.nixhyprland.nixhyprlock.nixhyprpaper.nixhyprpolkitagent.nixkeybinds.nixscratchpads.nixwindowrules.nixxdg-portals.nix
nix.nixvscode
yazi.nixzed
zsh
services
shell.nixhosts
secrets
@ -1,6 +1,5 @@
|
||||
[](https://builtwithnix.org)
|
||||
|
||||

|
||||
|
||||
# Nix Dotfiles
|
||||
|
||||
|
108
flake.lock
generated
108
flake.lock
generated
@ -1,5 +1,28 @@
|
||||
{
|
||||
"nodes": {
|
||||
"anyrun": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743762088,
|
||||
"narHash": "sha256-f+oXT9b3xuBDmm4v4nDqJvlHabxxZRB6+pay4Ub/NvA=",
|
||||
"owner": "anyrun-org",
|
||||
"repo": "anyrun",
|
||||
"rev": "786f539d69d5abcefa68978dbaa964ac14536a00",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "anyrun-org",
|
||||
"ref": "master",
|
||||
"repo": "anyrun",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@ -16,9 +39,30 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"anyrun",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743550720,
|
||||
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
@ -41,16 +85,16 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747556831,
|
||||
"narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=",
|
||||
"lastModified": 1745557122,
|
||||
"narHash": "sha256-eqSo9ugzsqhFgaDFYUZj943nurlX4L6f+AW0skJ4W+M=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33",
|
||||
"rev": "dd26f75fb4ec1c731d4b1396eaf4439ce40a91c1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-25.05",
|
||||
"ref": "release-24.11",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
@ -123,11 +167,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747706637,
|
||||
"narHash": "sha256-NKQVKIVuF0PfI03ear6jW29KaM91IBR0eo8NxrOF+70=",
|
||||
"lastModified": 1745805739,
|
||||
"narHash": "sha256-ryJ95o+w0hSVm5LkW5dxTbL2e1HCHCPcpNh627D3KHU=",
|
||||
"owner": "infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"rev": "5f921cf5b1230b392c69154152ff9198de9bb625",
|
||||
"rev": "ea8fa40a5fbf2762c41efc913c03aed3587ec7fa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -139,11 +183,11 @@
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1747723695,
|
||||
"narHash": "sha256-lSXzv33yv1O9r9Ai1MtYFDX3OKhWsZMn/5FFb4Rni/k=",
|
||||
"lastModified": 1745503349,
|
||||
"narHash": "sha256-bUGjvaPVsOfQeTz9/rLTNLDyqbzhl0CQtJJlhFPhIYw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "6ac6ec6fcb410e15a60ef5ec94b8a2b35b5dd282",
|
||||
"rev": "f7bee55a5e551bd8e7b5b82c9bc559bc50d868d1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -155,26 +199,26 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1747610100,
|
||||
"narHash": "sha256-rpR5ZPMkWzcnCcYYo3lScqfuzEw5Uyfh+R0EKZfroAc=",
|
||||
"lastModified": 1745742390,
|
||||
"narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ca49c4304acf0973078db0a9d200fd2bae75676d",
|
||||
"rev": "26245db0cb552047418cfcef9a25da91b222d6c7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-25.05",
|
||||
"ref": "nixos-24.11",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1747696584,
|
||||
"narHash": "sha256-TvJjbLlQ5aAHS3ZdP8mztNs28cMGWdT3J9g/6li3/4I=",
|
||||
"lastModified": 1745377448,
|
||||
"narHash": "sha256-jhZDfXVKdD7TSEGgzFJQvEEZ2K65UMiqW5YJ2aIqxMA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "359c442b7d1f6229c1dc978116d32d6c07fe8440",
|
||||
"rev": "507b63021ada5fee621b6ca371c4fca9ca46f52c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -185,11 +229,11 @@
|
||||
},
|
||||
"nixpkgs-yet-unstabler": {
|
||||
"locked": {
|
||||
"lastModified": 1747762468,
|
||||
"narHash": "sha256-I8l6r639PrDpEpAFgY64GmuQ+4NK+nxqAoSUnAEKw9E=",
|
||||
"lastModified": 1745831704,
|
||||
"narHash": "sha256-HMoKsZr3POMhCCIN1sFbPmYZ5ZBT/pCeyZnUXnJchdc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6bd7ba77ef6015853d67a89bd59f01b2880e9050",
|
||||
"rev": "7aa91c307d9af07d6900b337cecd02da067e8433",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -221,6 +265,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"anyrun": "anyrun",
|
||||
"home-manager": "home-manager",
|
||||
"matrix-synapse-next": "matrix-synapse-next",
|
||||
"maunium-stickerpicker": "maunium-stickerpicker",
|
||||
@ -240,11 +285,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747603214,
|
||||
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=",
|
||||
"lastModified": 1745310711,
|
||||
"narHash": "sha256-ePyTpKEJTgX0gvgNQWd7tQYQ3glIkbqcW778RpHlqgA=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd",
|
||||
"rev": "5e3e92b16d6fdf9923425a8d4df7496b2434f39c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -254,6 +299,21 @@
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1689347949,
|
||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
|
18
flake.nix
18
flake.nix
@ -1,11 +1,11 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-25.05";
|
||||
nixpkgs.url = "nixpkgs/nixos-24.11";
|
||||
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
||||
nixpkgs-yet-unstabler.url = "github:NixOS/nixpkgs/master";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.05";
|
||||
url = "github:nix-community/home-manager/release-24.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
@ -35,6 +35,11 @@
|
||||
url = "github:dali99/nixos-matrix-modules/0.7.0";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
anyrun = {
|
||||
url = "github:anyrun-org/anyrun/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{
|
||||
@ -50,7 +55,7 @@
|
||||
minecraft,
|
||||
osuchan,
|
||||
sops-nix,
|
||||
# anyrun,
|
||||
anyrun,
|
||||
}: let
|
||||
system = "x86_64-linux";
|
||||
|
||||
@ -62,7 +67,10 @@
|
||||
android_sdk.accept_license = true;
|
||||
segger-jlink.acceptLicense = true;
|
||||
permittedInsecurePackages = [
|
||||
"segger-jlink-qt4-810"
|
||||
"segger-jlink-qt4-796s"
|
||||
"dotnet-core-combined"
|
||||
"dotnet-sdk-6.0.428"
|
||||
"dotnet-sdk-wrapped-6.0.428"
|
||||
];
|
||||
};
|
||||
|
||||
@ -142,7 +150,6 @@
|
||||
cargo = ./home/modules/programs/cargo;
|
||||
colors = ./home/modules/colors.nix;
|
||||
direnv-auto-prune = ./home/modules/programs/direnv/auto-prune.nix;
|
||||
downloads-sorter = ./home/modules/services/downloads-sorter.nix;
|
||||
gpg = ./home/modules/programs/gpg;
|
||||
mpd-auto-updater = ./home/modules/services/mpd.nix;
|
||||
neovim-auto-clean-swapfiles = ./home/modules/programs/neovim/auto-clean-swapfiles.nix;
|
||||
@ -220,6 +227,7 @@
|
||||
|
||||
sharedModules = [
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
inputs.anyrun.homeManagerModules.default
|
||||
] ++ (builtins.attrValues self.homeModules);
|
||||
|
||||
users.h7x4.imports = [
|
||||
|
@ -1,129 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.services.downloads-sorter;
|
||||
in
|
||||
{
|
||||
services.downloads-sorter = {
|
||||
enable = true;
|
||||
mappings = {
|
||||
"archives" = [
|
||||
"*.rar"
|
||||
"*.zip"
|
||||
"*.7z"
|
||||
"*.tar"
|
||||
|
||||
"*.tar.bz2"
|
||||
"*.tar.gz"
|
||||
"*.tar.lz4"
|
||||
"*.tar.lzma"
|
||||
"*.tar.sz"
|
||||
"*.tar.sz"
|
||||
"*.tar.xz"
|
||||
"*.tar.zst"
|
||||
|
||||
"*.tbz"
|
||||
"*.tbz2"
|
||||
"*.tgz"
|
||||
"*.tlz4"
|
||||
"*.tlzma"
|
||||
"*.tsz"
|
||||
"*.txz"
|
||||
"*.tzst"
|
||||
|
||||
"*.bz2"
|
||||
"*.gz"
|
||||
"*.lz4"
|
||||
"*.lzma"
|
||||
"*.sz"
|
||||
"*.sz"
|
||||
"*.xz"
|
||||
"*.zst"
|
||||
];
|
||||
|
||||
"pictures" = {
|
||||
createDirIfNotExists = false;
|
||||
globs = [
|
||||
"*.gif"
|
||||
"*.jpeg"
|
||||
"*.jpg"
|
||||
"*.png"
|
||||
"*.svg"
|
||||
"*.webp"
|
||||
];
|
||||
};
|
||||
|
||||
"docs" = {
|
||||
createDirIfNotExists = false;
|
||||
globs = [
|
||||
"*.md"
|
||||
|
||||
"*.pdf"
|
||||
"*.PDF" # why do people do this
|
||||
|
||||
"*.docx"
|
||||
"*.doc"
|
||||
|
||||
"*.xlsx"
|
||||
"*.xls"
|
||||
|
||||
"*.ppt"
|
||||
"*.pptx"
|
||||
|
||||
"*.odt"
|
||||
"*.ods"
|
||||
"*.odp"
|
||||
"*.odg"
|
||||
"*.odf"
|
||||
];
|
||||
};
|
||||
|
||||
"books" = {
|
||||
createDirIfNotExists = false;
|
||||
globs = [ "*.epub" ];
|
||||
};
|
||||
|
||||
"videos" = {
|
||||
createDirIfNotExists = false;
|
||||
globs = [
|
||||
"*.mp4"
|
||||
"*.webm"
|
||||
"*.mov"
|
||||
];
|
||||
};
|
||||
|
||||
"isos" = [
|
||||
"*.iso"
|
||||
"*.img"
|
||||
];
|
||||
"jars" = [ "*.jar" ];
|
||||
"txt" = [ "*.txt" ];
|
||||
"patches" = [
|
||||
"*.patch"
|
||||
"*.diff"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.settings."10-downloads-sorter-service" = let
|
||||
inherit (cfg) downloadsDirectory;
|
||||
inherit (config.xdg) userDirs;
|
||||
|
||||
symlink = link: target: {
|
||||
"${link}".L = {
|
||||
user = config.home.username;
|
||||
mode = "0770";
|
||||
argument = "${target}";
|
||||
};
|
||||
|
||||
"${target}".d = {
|
||||
user = config.home.username;
|
||||
mode = "0770";
|
||||
};
|
||||
};
|
||||
in lib.mkMerge [
|
||||
(symlink "${downloadsDirectory}/books" "${userDirs.documents}/books/downloads")
|
||||
(symlink "${downloadsDirectory}/docs" "${userDirs.documents}/downloads")
|
||||
(symlink "${downloadsDirectory}/pictures" "${userDirs.pictures}/downloads")
|
||||
(symlink "${downloadsDirectory}/videos" "${userDirs.videos}/downloads")
|
||||
];
|
||||
}
|
@ -1,46 +1,27 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
systemd.user.tmpfiles.settings."05-homedir" = let
|
||||
home = config.home.homeDirectory;
|
||||
user = config.home.username;
|
||||
let
|
||||
home = config.home.homeDirectory;
|
||||
user = config.home.username;
|
||||
in {
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"d ${home}/SD - ${user} - - -"
|
||||
"d ${home}/ctf - ${user} - - -"
|
||||
"d ${home}/git - ${user} - - -"
|
||||
"d ${home}/pvv - ${user} - - -"
|
||||
"d ${home}/work - ${user} - - -"
|
||||
|
||||
defaultDirConf = {
|
||||
d = {
|
||||
inherit user;
|
||||
mode = "0700";
|
||||
};
|
||||
};
|
||||
"d ${home}/pictures/icons - ${user} - - -"
|
||||
"d ${home}/pictures/photos - ${user} - - -"
|
||||
"d ${home}/pictures/screenshots - ${user} - - -"
|
||||
"d ${home}/pictures/stickers - ${user} - - -"
|
||||
"d ${home}/pictures/wallpapers - ${user} - - -"
|
||||
|
||||
symlink = target: {
|
||||
L = {
|
||||
inherit user;
|
||||
argument = target;
|
||||
mode = "0600";
|
||||
};
|
||||
};
|
||||
in {
|
||||
"${home}/SD" = defaultDirConf;
|
||||
"${home}/ctf" = defaultDirConf;
|
||||
"${home}/git" = defaultDirConf;
|
||||
"${home}/pvv" = defaultDirConf;
|
||||
"${home}/tmp" = defaultDirConf;
|
||||
"${home}/work" = defaultDirConf;
|
||||
"d ${home}/documents/books - ${user} - - -"
|
||||
"d ${home}/documents/scans - ${user} - - -"
|
||||
|
||||
"${home}/pictures/icons" = defaultDirConf;
|
||||
"${home}/pictures/photos" = defaultDirConf;
|
||||
"${home}/pictures/screenshots" = defaultDirConf;
|
||||
"${home}/pictures/stickers" = defaultDirConf;
|
||||
"${home}/pictures/wallpapers" = defaultDirConf;
|
||||
"L ${home}/Downloads - ${user} - - ${home}/downloads"
|
||||
|
||||
"${home}/documents/books" = defaultDirConf;
|
||||
"${home}/documents/manuals" = defaultDirConf;
|
||||
"${home}/documents/music-sheets" = defaultDirConf;
|
||||
"${home}/documents/scans" = defaultDirConf;
|
||||
"${home}/documents/schematics" = defaultDirConf;
|
||||
|
||||
"${home}/Downloads" = symlink "${home}/downloads";
|
||||
|
||||
"${config.xdg.dataHome}/wallpapers" = symlink "${home}/pictures/wallpapers";
|
||||
"${config.home.sessionVariables.TEXMFHOME}" = symlink "${home}/git/texmf";
|
||||
};
|
||||
"L ${config.xdg.dataHome}/wallpapers - ${user} - - ${home}/pictures/wallpapers"
|
||||
"L ${config.home.sessionVariables.TEXMFHOME} - ${user} - - ${home}/git/texmf"
|
||||
];
|
||||
}
|
||||
|
@ -1,21 +1,16 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.xdg.userDirs;
|
||||
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./mimetypes.nix
|
||||
./directory-spec-overrides.nix
|
||||
];
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
userDirs = {
|
||||
enable = true;
|
||||
desktop = lib.mkDefault "${config.home.homeDirectory}/Desktop";
|
||||
documents = lib.mkDefault "${config.home.homeDirectory}/documents";
|
||||
download = lib.mkDefault "${config.home.homeDirectory}/downloads";
|
||||
download = lib.mkDefault "${config.home.homeDirectory}/Downloads";
|
||||
music = lib.mkDefault "${config.home.homeDirectory}/music";
|
||||
pictures = lib.mkDefault "${config.home.homeDirectory}/pictures";
|
||||
publicShare = lib.mkDefault "${config.home.homeDirectory}/public";
|
||||
@ -23,22 +18,4 @@ in
|
||||
videos = lib.mkDefault "${config.home.homeDirectory}/videos";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.settings."05-xdg-userdirs" = let
|
||||
dirCfg = {
|
||||
d = {
|
||||
user = config.home.username;
|
||||
mode = "0700";
|
||||
};
|
||||
};
|
||||
in {
|
||||
"${cfg.desktop}" = dirCfg;
|
||||
"${cfg.documents}" = dirCfg;
|
||||
"${cfg.download}" = dirCfg;
|
||||
"${cfg.music}" = dirCfg;
|
||||
"${cfg.pictures}" = dirCfg;
|
||||
"${cfg.publicShare}" = dirCfg;
|
||||
"${cfg.templates}" = dirCfg;
|
||||
"${cfg.videos}" = dirCfg;
|
||||
};
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ in {
|
||||
|
||||
./config/xdg
|
||||
./config/ensure-homedir-structure.nix
|
||||
./config/downloads-sorter.nix
|
||||
|
||||
./programs/aria2.nix
|
||||
./programs/atuin.nix
|
||||
@ -45,7 +44,6 @@ in {
|
||||
./programs/thunderbird.nix
|
||||
./programs/tmux
|
||||
./programs/uv.nix
|
||||
./programs/yazi.nix
|
||||
./programs/yt-dlp.nix
|
||||
./programs/zoxide.nix
|
||||
./programs/zsh
|
||||
@ -82,7 +80,7 @@ in {
|
||||
./services/psd.nix
|
||||
./services/tumblerd.nix
|
||||
]) ++ (optionals machineVars.wayland [
|
||||
./programs/hyprland
|
||||
./programs/hyprland.nix
|
||||
./programs/waybar.nix
|
||||
./programs/anyrun
|
||||
]) ++ (optionals (!machineVars.wayland) [
|
||||
@ -117,7 +115,8 @@ in {
|
||||
package = pkgs.capitaine-cursors;
|
||||
name = "capitaine-cursors";
|
||||
size = 16;
|
||||
dotIcons.enable = false;
|
||||
# TODO: enable in 25.05
|
||||
# dotIcons = false;
|
||||
};
|
||||
|
||||
keyboard.options = [ "caps:escape" ];
|
||||
|
@ -25,7 +25,6 @@ in
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe cfg.package} prune";
|
||||
|
@ -32,7 +32,6 @@ in
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe cfg.package} --refresh-keys";
|
||||
|
@ -32,7 +32,6 @@ in
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe cfg.package} --update-trustdb";
|
||||
|
@ -31,7 +31,6 @@ in
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
||||
|
@ -26,7 +26,6 @@ in
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --execute=reload";
|
||||
|
@ -25,7 +25,6 @@ in
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --vacuum";
|
||||
|
@ -44,7 +44,6 @@ in
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
||||
name = "fetch-nix-index-database";
|
||||
runtimeInputs = with pkgs; [
|
||||
|
@ -3,10 +3,6 @@ let
|
||||
cfg = config.programs.prism-launcher;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../systemd-tmpfiles.nix
|
||||
];
|
||||
|
||||
options.programs.prism-launcher = {
|
||||
enable = lib.mkEnableOption "PrismLauncher, an open source minecraft launcher";
|
||||
|
||||
@ -61,7 +57,6 @@ in
|
||||
Unit.Description = "Watchdog that moves screenshots from all prismlauncher minecraft instances into a common dir";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
||||
name = "prismlauncher-move-minecraft-screenshots.sh";
|
||||
runtimeInputs = with pkgs; [ coreutils findutils ];
|
||||
@ -101,10 +96,8 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.settings."10-prismlauncher" = lib.mkIf cfg.screenshotMover.enable {
|
||||
${cfg.screenshotMover.screenshotDir}.d = {
|
||||
user = config.home.username;
|
||||
};
|
||||
};
|
||||
systemd.user.tmpfiles.rules = lib.mkIf cfg.screenshotMover.enable [
|
||||
"'d' '${cfg.screenshotMover.screenshotDir}' - ${config.home.username} - - -"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@ -1,160 +1,5 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.downloads-sorter;
|
||||
in
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
../systemd-tmpfiles.nix
|
||||
];
|
||||
|
||||
options.services.downloads-sorter = {
|
||||
enable = lib.mkEnableOption "downloads sorter units, path activated units to keep the download dir clean";
|
||||
|
||||
downloadsDirectory = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Which directory to keep clean";
|
||||
default = if config.xdg.userDirs.enable then config.xdg.userDirs.download else "${config.home.homeDirectory}/Downloads";
|
||||
defaultText = ''
|
||||
if config.xdg.userDirs.enable then config.xdg.userDirs.download else "''${config.home.homeDirectory}/Downloads"
|
||||
'';
|
||||
example = ''
|
||||
"''${config.home.homeDirectory}/downloads"
|
||||
'';
|
||||
};
|
||||
|
||||
mappings = lib.mkOption {
|
||||
type = let
|
||||
mappingType = lib.types.submodule ({ name, ... }: {
|
||||
options = {
|
||||
unitName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The basename of the path/service unit responsible for this mapping
|
||||
'';
|
||||
default = "downloads-sorter@${name}";
|
||||
example = "downloads-sorter@asdf";
|
||||
};
|
||||
|
||||
dir = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = ''
|
||||
Absolute path to the directory where matching files should be moved.
|
||||
'';
|
||||
default = if builtins.substring 0 1 name == "/" then name else "${cfg.downloadsDirectory}/${name}";
|
||||
defaultText = ''
|
||||
if builtins.substring 0 1 name == "/" then name else "''${config.services.downloads-sorter.downloadsDirectory}/''${name}"
|
||||
'';
|
||||
};
|
||||
|
||||
globs = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
description = ''
|
||||
A list of globs that match the files that should be moved.
|
||||
'';
|
||||
example = [
|
||||
"*.jpg"
|
||||
"IMG_*_2020_*.png"
|
||||
];
|
||||
apply = map (g: "${cfg.downloadsDirectory}/${g}");
|
||||
};
|
||||
|
||||
createDirIfNotExists = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Whether to create the target directory if it does not exist yet.
|
||||
|
||||
Turn this off if you'd like the target directory to be a symlink or similar.
|
||||
'';
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
|
||||
# TODO: allow specifying a dynamic filter together with a system path trigger in an attrset.
|
||||
};
|
||||
});
|
||||
in with lib.types; attrsOf (coercedTo (listOf str) (globs: { inherit globs; }) mappingType);
|
||||
description = ''
|
||||
A mapping from a file pattern to the location where it should be moved.
|
||||
|
||||
By default, the output mapping is relative to the download dir.
|
||||
If an absolute path is given, the sorter will move the files out of the downloads dir.
|
||||
'';
|
||||
default = { };
|
||||
example = {
|
||||
"pictures" = [
|
||||
"*.png"
|
||||
"*.jpg"
|
||||
];
|
||||
"documents" = {
|
||||
createDirIfNotExists = false;
|
||||
globs = [ "*.pdf" ];
|
||||
};
|
||||
"/home/<user>/archives" = [ "*.rar" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.user.paths = lib.mapAttrs' (dir: mapping: {
|
||||
name = mapping.unitName;
|
||||
value = {
|
||||
Install.WantedBy = [ "paths.target" ];
|
||||
Path = {
|
||||
PathExistsGlob = mapping.globs;
|
||||
Unit = "${mapping.unitName}.service";
|
||||
TriggerLimitIntervalSec = "1s";
|
||||
TriggerLimitBurst = "1";
|
||||
};
|
||||
};
|
||||
}) cfg.mappings;
|
||||
|
||||
# TODO: deduplicate
|
||||
systemd.user.services = lib.mapAttrs' (dir: mapping: {
|
||||
name = mapping.unitName;
|
||||
value = {
|
||||
Unit.Description = "Downloads directory watchdog, sorts the downloads directory";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
SyslogIdentifier = mapping.unitName;
|
||||
ExecStart = let
|
||||
script = pkgs.writeShellApplication {
|
||||
name = "downloads-sorter-${dir}.sh";
|
||||
runtimeInputs = [ pkgs.coreutils ];
|
||||
text = ''
|
||||
shopt -s nullglob
|
||||
|
||||
FILES=(${builtins.concatStringsSep " " mapping.globs})
|
||||
|
||||
for file in "''${FILES[@]}"; do
|
||||
echo "$file -> ${mapping.dir}"
|
||||
mv "$file" '${mapping.dir}'
|
||||
done
|
||||
'';
|
||||
};
|
||||
in lib.getExe script;
|
||||
|
||||
PrivateUsers = true;
|
||||
ProtectSystem = true;
|
||||
NoNewPrivileges = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectControlGroups = true;
|
||||
PrivateNetwork = true;
|
||||
RestrictNamespaces = true;
|
||||
};
|
||||
};
|
||||
}) cfg.mappings;
|
||||
|
||||
systemd.user.tmpfiles.settings."10-downloads-sorter-service" = let
|
||||
absolutePaths = lib.pipe cfg.mappings [
|
||||
builtins.attrValues
|
||||
(builtins.filter (m: m.createDirIfNotExists))
|
||||
(map (m: m.dir))
|
||||
];
|
||||
in lib.genAttrs absolutePaths (_: {
|
||||
d = {
|
||||
user = config.home.username;
|
||||
};
|
||||
});
|
||||
};
|
||||
# TODO: create abstraction over `systemd.path` thingy that looks at incoming files and
|
||||
# sorts them into subdirs by extension.
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ in
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "background.slice";
|
||||
ExecStart = "${lib.getExe pkgs.mpc-cli} update --wait";
|
||||
|
||||
PrivateUsers = true;
|
||||
|
@ -25,7 +25,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
isAlias = v: builtins.isAttrs v && v ? alias;
|
||||
isAlias = v: builtins.isAttrs v && v ? "alias" && v ? "type";
|
||||
};
|
||||
in {
|
||||
lib = formatLib;
|
||||
@ -47,29 +47,6 @@
|
||||
"grep nix"
|
||||
];
|
||||
};
|
||||
shells = lib.mkOption {
|
||||
description = "List of shells for which the alias is valid.";
|
||||
type = with lib.types; listOf (enum [
|
||||
"bash"
|
||||
"zsh"
|
||||
"fish"
|
||||
"nushell"
|
||||
]);
|
||||
default = [
|
||||
"bash"
|
||||
"zsh"
|
||||
"fish"
|
||||
"nushell"
|
||||
];
|
||||
example = [
|
||||
"bash"
|
||||
"zsh"
|
||||
];
|
||||
};
|
||||
# TODO:
|
||||
# subshell = lib.mkEnableOption "" // {
|
||||
# description = "Whether to run the aliased command in a subshell";
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
@ -82,34 +59,45 @@
|
||||
check = v: builtins.isString v || formatLib.isAlias v;
|
||||
};
|
||||
|
||||
aliasTreeType = with lib.types; attrsOf (either coercedAliasType aliasTreeType) // {
|
||||
description = "Alias tree";
|
||||
};
|
||||
aliasTreeType = with lib.types; attrsOf (either coercedAliasType aliasTreeType);
|
||||
in aliasTreeType;
|
||||
|
||||
# Alias Tree -> String -> { :: Alias }
|
||||
generateAttrs = shell: let
|
||||
generateAttrs' = attrset: lib.pipe attrset [
|
||||
(attrset: {
|
||||
right = lib.filterAttrs (_: v: formatLib.isAlias v) attrset;
|
||||
wrong = lib.filterAttrs (_: v: !(formatLib.isAlias v)) attrset;
|
||||
})
|
||||
({ right, wrong }:
|
||||
# Leaf nodes
|
||||
(lib.pipe right [
|
||||
(lib.filterAttrs (_: v: lib.elem shell v.shells))
|
||||
(builtins.mapAttrs (_: v: formatLib.functors.${v.type}.apply v))
|
||||
])
|
||||
//
|
||||
# Subsets
|
||||
(lib.pipe wrong [
|
||||
builtins.attrValues
|
||||
(map generateAttrs')
|
||||
(lib.foldr (a: b: a // b) { })
|
||||
])
|
||||
)
|
||||
];
|
||||
in generateAttrs';
|
||||
# Alias Tree -> { :: Alias }
|
||||
generateAttrs = let
|
||||
inherit (lib) mapAttrs attrValues filterAttrs isAttrs
|
||||
isString concatStringsSep foldr;
|
||||
|
||||
applyFunctor = attrset: formatLib.functors.${attrset.type}.apply attrset;
|
||||
|
||||
# TODO: better naming
|
||||
allAttrValuesAreStrings = attrset: let
|
||||
|
||||
# [ {String} ]
|
||||
filteredAliases = [(filterAttrs (_: isString) attrset)];
|
||||
|
||||
# [ {String} ]
|
||||
remainingFunctors = let
|
||||
functorSet = filterAttrs (_: formatLib.isAlias) attrset;
|
||||
appliedFunctorSet = mapAttrs (_: applyFunctor) functorSet;
|
||||
in [ appliedFunctorSet ];
|
||||
|
||||
# [ {AttrSet} ]
|
||||
remainingAliasSets = attrValues (filterAttrs (_: v: isAttrs v && !formatLib.isAlias v) attrset);
|
||||
|
||||
# [ {String} ]
|
||||
recursedAliasSets = filteredAliases
|
||||
++ (remainingFunctors)
|
||||
++ (map allAttrValuesAreStrings remainingAliasSets);
|
||||
in foldr (a: b: a // b) {} recursedAliasSets;
|
||||
|
||||
in
|
||||
allAttrValuesAreStrings;
|
||||
|
||||
# TODO:
|
||||
# generateAttrs = pipe [
|
||||
# collect leave nodes
|
||||
# map apply functor
|
||||
# ]
|
||||
|
||||
# Alias Tree -> String
|
||||
generateText = aliases: let
|
||||
@ -255,20 +243,20 @@ in {
|
||||
|
||||
programs = {
|
||||
zsh = {
|
||||
shellAliases = shellAliasesFormat.generateAttrs "zsh" cfg.aliases;
|
||||
shellAliases = shellAliasesFormat.generateAttrs cfg.aliases;
|
||||
sessionVariables = cfg.variables;
|
||||
};
|
||||
bash = {
|
||||
shellAliases = shellAliasesFormat.generateAttrs "bash" cfg.aliases;
|
||||
shellAliases = shellAliasesFormat.generateAttrs cfg.aliases;
|
||||
sessionVariables = cfg.variables;
|
||||
};
|
||||
fish = {
|
||||
shellAliases = shellAliasesFormat.generateAttrs "fish" cfg.aliases;
|
||||
shellAliases = shellAliasesFormat.generateAttrs cfg.aliases;
|
||||
# TODO: fish does not support session variables?
|
||||
# localVariables = cfg.variables;
|
||||
};
|
||||
nushell = {
|
||||
shellAliases = shellAliasesFormat.generateAttrs "nushell" cfg.aliases;
|
||||
shellAliases = shellAliasesFormat.generateAttrs cfg.aliases;
|
||||
environmentVariables = cfg.variables;
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ pkgs, yet-unstabler-pkgs, config, machineVars, machineName, ... }:
|
||||
{ pkgs, config, machineVars, machineName, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
bandwhich
|
||||
@ -7,7 +7,7 @@
|
||||
cyme
|
||||
czkawka
|
||||
difftastic
|
||||
# diskonaut
|
||||
diskonaut
|
||||
duf
|
||||
duff
|
||||
fclones
|
||||
@ -90,11 +90,11 @@
|
||||
ahoviewer
|
||||
alsa-utils
|
||||
anki
|
||||
kdePackages.ark
|
||||
ark
|
||||
calibre
|
||||
cool-retro-term
|
||||
darktable
|
||||
yet-unstabler-pkgs.discord
|
||||
discord
|
||||
element-desktop
|
||||
foliate
|
||||
geogebra
|
||||
@ -110,7 +110,7 @@
|
||||
kid3
|
||||
koreader
|
||||
krita
|
||||
# kdePackages.ktouch
|
||||
ktouch
|
||||
libnotify
|
||||
libreoffice
|
||||
light
|
||||
@ -158,8 +158,8 @@
|
||||
touchegg
|
||||
] ++ lib.optionals (machineVars.gaming) [
|
||||
desmume
|
||||
# osu-lazer
|
||||
# retroarchFull
|
||||
osu-lazer
|
||||
retroarchFull
|
||||
steam
|
||||
steam-tui
|
||||
stepmania
|
||||
|
@ -7,7 +7,7 @@
|
||||
y.fraction = 0.3;
|
||||
width.fraction = 0.25;
|
||||
plugins = [
|
||||
"${pkgs.anyrun}/lib/libapplications.so"
|
||||
inputs.anyrun.packages.${pkgs.system}.applications
|
||||
];
|
||||
hidePluginInfo = true;
|
||||
closeOnClick = true;
|
||||
@ -30,10 +30,7 @@
|
||||
desktop_actions: false,
|
||||
max_entries: 10,
|
||||
preprocess_exec_script: Some("${lib.getExe preprocess_script}"),
|
||||
terminal: Some(Terminal(
|
||||
command: "${lib.getExe pkgs.alacritty}",
|
||||
args: "-e {}",
|
||||
)),
|
||||
terminal: Some("${lib.getExe pkgs.alacritty}"),
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
@ -1,10 +1,10 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
"amazondotcom-us".metaData.hidden = true;
|
||||
"bing".metaData.hidden = true;
|
||||
"wikipedia".metaData.hidden = true;
|
||||
"google".metaData.alias = "gg";
|
||||
"ddg".metaData.alias = "dd";
|
||||
"Amazon.com".metaData.hidden = true;
|
||||
"Bing".metaData.hidden = true;
|
||||
"Wikipedia (en)".metaData.hidden = true;
|
||||
"Google".metaData.alias = "gg";
|
||||
"DuckDuckGo".metaData.alias = "dd";
|
||||
|
||||
"Arch Package Repository" = {
|
||||
urls = [{
|
||||
@ -166,7 +166,7 @@
|
||||
definedAliases = [ "ut" ];
|
||||
};
|
||||
|
||||
"youtube" = {
|
||||
"YouTube" = {
|
||||
urls = [{
|
||||
template = "https://www.youtube.com/results";
|
||||
params = [{ name = "search_query"; value = "{searchTerms}"; }];
|
||||
|
@ -3,16 +3,13 @@
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
profiles.h7x4 = {
|
||||
bookmarks = {
|
||||
force = true;
|
||||
settings = [{
|
||||
toolbar = true;
|
||||
bookmarks = import ./browser/bookmarks.nix;
|
||||
}];
|
||||
};
|
||||
bookmarks = [{
|
||||
toolbar = true;
|
||||
bookmarks = import ./browser/bookmarks.nix;
|
||||
}];
|
||||
|
||||
search = {
|
||||
default = "google";
|
||||
default = "Google";
|
||||
engines = import ./browser/engines.nix { inherit pkgs lib; };
|
||||
force = true;
|
||||
};
|
||||
|
@ -21,5 +21,5 @@
|
||||
set prompt \001\033[1;36m\002(gdb) \001\033[0m\002
|
||||
'';
|
||||
|
||||
# local.shell.aliases."System Tool Replacements".gdb = "${pkgs.pwndbg}/bin/pwndbg";
|
||||
local.shell.aliases."System Tool Replacements".gdb = "${pkgs.pwndbg}/bin/pwndbg";
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ in
|
||||
echo "[maintenance]"
|
||||
for repoLocation in ${repoDirs}; do
|
||||
for repo in "$repoLocation"/*/.git; do
|
||||
echo "repo = $('${pkgs.coreutils}/bin/realpath' "''${repo%"/.git"}")"
|
||||
echo "repo = $("${pkgs.coreutils}/bin/realpath" "''${repo%"/.git"}")"
|
||||
done
|
||||
done
|
||||
} > "$1"
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
pinentry.package = pkgs.pinentry-curses;
|
||||
pinentryPackage = pkgs.pinentry-curses;
|
||||
enableExtraSocket = true;
|
||||
enableSshSupport = true;
|
||||
enableScDaemon = true;
|
||||
|
380
home/programs/hyprland.nix
Normal file
380
home/programs/hyprland.nix
Normal file
@ -0,0 +1,380 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
home.sessionVariables = {
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
WLR_RENDERER_ALLOW_SOFTWARE = "1";
|
||||
XDG_CURRENT_DESKTOP = "Hyprland";
|
||||
XDG_SESSION_DESKTOP = "Hyprland";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
GDK_BACKEND = "wayland,x11,*";
|
||||
QT_QPA_PLATFORM = "wayland;xcb";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
SDL_VIDEODRIVER = "wayland";
|
||||
OZONE_PLATFORM = "wayland";
|
||||
CLUTTER_BACKEND = "wayland";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
# QT_QPA_PLATFORMTHEME = "qt6ct";
|
||||
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||
|
||||
# LIBVA_DRIVER_NAME = "nvidia";
|
||||
# GBM_BACKEND = "nvidia-drm";
|
||||
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
hyprpolkitagent
|
||||
wl-clipboard-rs
|
||||
];
|
||||
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
disable_loading_bar = true;
|
||||
grace = 0;
|
||||
hide_cursor = true;
|
||||
no_fade_in = false;
|
||||
};
|
||||
|
||||
background = [
|
||||
{
|
||||
path = "screenshot";
|
||||
blur_passes = 3;
|
||||
blur_size = 8;
|
||||
}
|
||||
];
|
||||
|
||||
input-field = [
|
||||
{
|
||||
size = "200, 50";
|
||||
position = "0, -80";
|
||||
monitor = "";
|
||||
dots_center = true;
|
||||
fade_on_empty = false;
|
||||
font_color = "rgb(202, 211, 245)";
|
||||
inner_color = "rgb(91, 96, 120)";
|
||||
outer_color = "rgb(24, 25, 38)";
|
||||
outline_thickness = 5;
|
||||
placeholder_text = ''Password...'';
|
||||
shadow_passes = 2;
|
||||
}
|
||||
];
|
||||
|
||||
auth = {
|
||||
"pam:enabled" = true;
|
||||
"pam:module" = "hyprlock";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
ignore_dbus_inhibit = false;
|
||||
lock_cmd = "pidof hyprlock || ${config.programs.hyprlock.package}/bin/hyprlock";
|
||||
before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
after_sleep_cmd = "${cfg.finalPackage}/bin/hyprctl dispatch dpms on";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 900;
|
||||
on-timeout = "${config.programs.hyprlock.package}/bin/hyprlock";
|
||||
}
|
||||
{
|
||||
timeout = 1200;
|
||||
on-timeout = "${cfg.finalPackage}/bin/hyprctl dispatch dpms off";
|
||||
on-resume = "${cfg.finalPackage}/bin/hyprctl dispatch dpms on";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
systemd.enable = false;
|
||||
systemd.enableXdgAutostart = false;
|
||||
|
||||
settings = let
|
||||
exe = lib.getExe;
|
||||
scratchpads = [
|
||||
(rec {
|
||||
title = "Floating terminal";
|
||||
class = "floatingTerminal";
|
||||
command = "uwsm app -- ${exe pkgs.alacritty} --class ${class} -e ${exe pkgs.tmux} new-session -A -s f";
|
||||
size = { h = 90; w = 95; };
|
||||
keys = [
|
||||
"$mod, RETURN"
|
||||
"$mod, SPACE"
|
||||
];
|
||||
})
|
||||
(rec {
|
||||
title = "Ncmpcpp";
|
||||
class = "floatingNcmpcpp";
|
||||
command = "uwsm app -- ${exe pkgs.alacritty} --class ${class} -e ${exe pkgs.ncmpcpp}";
|
||||
size = { h = 95; w = 95; };
|
||||
keys = [ "$mod, Q" ];
|
||||
})
|
||||
# "$mod, W, emacs"
|
||||
# "$mod, E, filebrowser"
|
||||
# "$mod, X, taskwarriortui"
|
||||
];
|
||||
in {
|
||||
"$mod" = "SUPER";
|
||||
|
||||
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
||||
bind = [
|
||||
"$mod SHIFT, Q, exec, ${pkgs.systemd}/bin/loginctl terminate-user \"\""
|
||||
"$mod ALT SHIFT, Q, exec, uwsm stop"
|
||||
"$mod, R, exec, uwsm app -- ${exe config.programs.anyrun.package}"
|
||||
"$mod, T, togglefloating"
|
||||
|
||||
"$mod, F, fullscreenstate, 1"
|
||||
"$mod SHIFT, F, fullscreenstate, 3"
|
||||
"$mod, C, exec, ${cfg.finalPackage}/bin/hyprctl reload"
|
||||
|
||||
"$mod, BACKSPACE, killactive"
|
||||
|
||||
"$mod SHIFT, RETURN, exec, uwsm app -- ${exe pkgs.alacritty} --class termTerminal -e ${exe pkgs.tmux} new-session -A -s term"
|
||||
"$mod SHIFT, SPACE, exec, uwsm app -- ${exe pkgs.alacritty} --class termTerminal -e ${exe pkgs.tmux} new-session -A -s term"
|
||||
|
||||
"$mod, j, layoutmsg,cyclenext"
|
||||
"$mod, k, layoutmsg,cycleprev"
|
||||
"$mod SHIFT, j, layoutmsg, swapnext"
|
||||
"$mod SHIFT, k, layoutmsg, swapprev"
|
||||
|
||||
"$mod, 1, focusworkspaceoncurrentmonitor, 1"
|
||||
"$mod, 2, focusworkspaceoncurrentmonitor, 2"
|
||||
"$mod, 3, focusworkspaceoncurrentmonitor, 3"
|
||||
"$mod, 4, focusworkspaceoncurrentmonitor, 4"
|
||||
"$mod, 5, focusworkspaceoncurrentmonitor, 5"
|
||||
"$mod, 6, focusworkspaceoncurrentmonitor, 6"
|
||||
"$mod, 7, focusworkspaceoncurrentmonitor, 7"
|
||||
"$mod, 8, focusworkspaceoncurrentmonitor, 8"
|
||||
"$mod, 9, focusworkspaceoncurrentmonitor, 9"
|
||||
|
||||
"$mod SHIFT, 1, movetoworkspacesilent, 1"
|
||||
"$mod SHIFT, 2, movetoworkspacesilent, 2"
|
||||
"$mod SHIFT, 3, movetoworkspacesilent, 3"
|
||||
"$mod SHIFT, 4, movetoworkspacesilent, 4"
|
||||
"$mod SHIFT, 5, movetoworkspacesilent, 5"
|
||||
"$mod SHIFT, 6, movetoworkspacesilent, 6"
|
||||
"$mod SHIFT, 7, movetoworkspacesilent, 7"
|
||||
"$mod SHIFT, 8, movetoworkspacesilent, 8"
|
||||
"$mod SHIFT, 9, movetoworkspacesilent, 9"
|
||||
|
||||
"$mod, b, exec, ${pkgs.fcitx5}/bin/fcitx5-remote -s mozc"
|
||||
"$mod, n, exec, ${pkgs.fcitx5}/bin/fcitx5-remote -s keyboard-no"
|
||||
"$mod, m, exec, ${pkgs.fcitx5}/bin/fcitx5-remote -s keyboard-us"
|
||||
|
||||
"$mod, l, exec, ${pkgs.systemd}/bin/loginctl lock-session"
|
||||
|
||||
# TODO: fix
|
||||
# "super + minus" = "${pkgs.xcalib}/bin/xcalib -invert -alter"
|
||||
|
||||
", Print, exec, ${exe pkgs.grimblast} copy area"
|
||||
|
||||
# "SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} copy area"
|
||||
# "shift + @Print" = "${pkgs.maim}/bin/maim --hidecursor --nokeyboard $SCREENSHOT_DIR/$(date +%s).png"
|
||||
|
||||
"$mod, Print, exec, ${exe pkgs.woomer}"
|
||||
]
|
||||
++
|
||||
(lib.pipe scratchpads [
|
||||
(map ({ keys, command, class, ... }:
|
||||
(map (key: let
|
||||
# TODO: rewrite this to take arguments instead of creating n copies
|
||||
invokeIfNotRunningAndToggleWorkspace = pkgs.writeShellApplication {
|
||||
name = "hyprland-toggle-scratchpad-${class}";
|
||||
runtimeInputs = [ cfg.finalPackage pkgs.jq ];
|
||||
text = ''
|
||||
SCRATCHPAD_PROGRAM_EXISTS=$(hyprctl clients -j | jq -r '[.[].class]|any(. == "${class}")')
|
||||
CURRENT_WORKSPACE_ID=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
|
||||
if [ "$SCRATCHPAD_PROGRAM_EXISTS" != "true" ]; then
|
||||
${command} &
|
||||
hyprctl dispatch movetoworkspacesilent "''${CURRENT_WORKSPACE_ID},class:${class}"
|
||||
hyprctl dispatch focuswindow "class:${class}"
|
||||
else
|
||||
SCRATCHPAD_PROGRAM_WORKSPACE_ID=$(hyprctl clients -j | jq '.[] | select( .class == "${class}") | .workspace.id')
|
||||
if [ "$SCRATCHPAD_PROGRAM_WORKSPACE_ID" != "$CURRENT_WORKSPACE_ID" ]; then
|
||||
hyprctl dispatch movetoworkspacesilent "''${CURRENT_WORKSPACE_ID},class:${class}"
|
||||
hyprctl dispatch focuswindow "class:${class}"
|
||||
else
|
||||
hyprctl dispatch movetoworkspacesilent "special:${class}Ws,class:${class}"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in "${key}, exec, ${lib.getExe invokeIfNotRunningAndToggleWorkspace}"
|
||||
) keys)
|
||||
))
|
||||
lib.flatten
|
||||
]);
|
||||
|
||||
bindm = [
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, Control_L, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
"$mod, ALT_L, resizewindow"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
"$mod, p, exec, ${exe pkgs.mpc_cli} toggle"
|
||||
",XF86AudioPlay, exec, ${exe pkgs.mpc_cli} toggle"
|
||||
",XF86AudioPrev, exec, ${exe pkgs.mpc_cli} prev"
|
||||
",XF86AudioNext, exec, ${exe pkgs.mpc_cli} next"
|
||||
];
|
||||
|
||||
bindle = [
|
||||
",XF86MonBrightnessUp, exec, ${exe pkgs.brightnessctl} s +5%"
|
||||
",XF86MonBrightnessDown, exec, ${exe pkgs.brightnessctl} s 5%-"
|
||||
",XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||
",XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+"
|
||||
"$mod ,F7, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||
"$mod ,F8, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+"
|
||||
];
|
||||
|
||||
exec-once = [
|
||||
"uwsm finalize"
|
||||
];
|
||||
|
||||
windowrulev2 = [
|
||||
"float, class:^(Rofi)$"
|
||||
"float, class:^(xdg-desktop-portal-gtk)$"
|
||||
"float, title:^(.*Bitwarden Password Manager.*)$"
|
||||
"float, title:^(Picture-in-Picture)$"
|
||||
"tile, class:^(Nsxiv)$"
|
||||
|
||||
"float, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
"size 70%, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
"center, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
|
||||
"dimaround, class:^(xdg-desktop-portal-gtk)$"
|
||||
|
||||
"workspace special silent, title:^(Firefox — Sharing Indicator)$"
|
||||
"workspace special silent, title:^(Zen — Sharing Indicator)$"
|
||||
"workspace special silent, title:^(.*is sharing (your screen|a window)\.)$"
|
||||
|
||||
"workspace 2, class:^(firefox)$"
|
||||
"workspace 2, class:^(google-chrome)$"
|
||||
|
||||
"workspace 3, class:^(Emacs)$"
|
||||
"workspace 3, class:^(code)$"
|
||||
"workspace 3, class:^(code-url-handler)$"
|
||||
"workspace 3, class:^(dev.zed.Zed)$"
|
||||
|
||||
"workspace 5, class:^(discord)$"
|
||||
"workspace 5, class:^(Element)$"
|
||||
]
|
||||
++
|
||||
(lib.pipe scratchpads [
|
||||
(map ({ class, size, ... }: [
|
||||
"workspace special:${class}Ws, class:^${class}$"
|
||||
"float, class:^${class}$"
|
||||
"size ${toString size.w}% ${toString size.h}%, class:^${class}$"
|
||||
"move ${toString ((100 - size.w) / 2)}% ${toString ((100 - size.h) / 2)}%, class:^${class}$"
|
||||
]))
|
||||
lib.flatten
|
||||
]);
|
||||
|
||||
monitor = [
|
||||
# TODO: host specific
|
||||
"eDP-1, 3840x2400@90.00Hz, 0x0, 2"
|
||||
|
||||
# PVV Demiurgen
|
||||
"desc:Hewlett Packard HP ZR24w CNT01711G6, 1920x1200, 0x-1200, 1"
|
||||
"desc:Hewlett Packard HP ZR24w CNT018103H, 1920x1200, 1920x-1200, 1"
|
||||
|
||||
# PVV Eirin
|
||||
"desc:Hewlett Packard HP ZR24w CNT01710L4, 1920x1200, 0x-1200, 1"
|
||||
"desc:Hewlett Packard HP ZR24w CNT0181039, 1920x1200, 1920x-1200, 1"
|
||||
|
||||
",preferred,auto,1"
|
||||
];
|
||||
|
||||
general = {
|
||||
gaps_in = 5;
|
||||
gaps_out = 15;
|
||||
|
||||
border_size = 2;
|
||||
|
||||
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
||||
"col.inactive_border" = "rgba(595959aa)";
|
||||
|
||||
resize_on_border = false;
|
||||
allow_tearing = false;
|
||||
layout = "master";
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
|
||||
# Change transparency of focused and unfocused windows
|
||||
active_opacity = 1.0;
|
||||
inactive_opacity = 1.0;
|
||||
|
||||
# drop_shadow = true;
|
||||
# shadow_range = 4;
|
||||
# shadow_render_power = 3;
|
||||
# "col.shadow" = "rgba(1a1a1aee)";
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#blur
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 3;
|
||||
passes = 1;
|
||||
|
||||
vibrancy = 0.1696;
|
||||
};
|
||||
};
|
||||
|
||||
animations.enabled = false;
|
||||
|
||||
master = {
|
||||
new_status = "slave";
|
||||
};
|
||||
|
||||
misc = {
|
||||
force_default_wallpaper = 0; # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
disable_hyprland_logo = false; # If true disables the random hyprland logo / anime girl background. :(
|
||||
};
|
||||
|
||||
input ={
|
||||
kb_layout = "us";
|
||||
kb_variant = "";
|
||||
kb_model = "";
|
||||
kb_options = "caps:escape";
|
||||
kb_rules = "";
|
||||
|
||||
follow_mouse = 1;
|
||||
|
||||
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
settings.ipc = true;
|
||||
};
|
||||
|
||||
# UWSM
|
||||
systemd.user.services = {
|
||||
hypridle.Unit.After = lib.mkForce "graphical-session.target";
|
||||
waybar.Unit.After = lib.mkForce "graphical-session.target";
|
||||
network-manager-applet.Unit.After = lib.mkForce "graphical-session.target";
|
||||
fcitx5-daemon.Unit.After = lib.mkForce "graphical-session.target";
|
||||
# hyprpaper.Unit.After = lib.mkForce "graphical-session.target";
|
||||
};
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./hypridle.nix
|
||||
./hyprland.nix
|
||||
./hyprlock.nix
|
||||
./hyprpaper.nix
|
||||
./hyprpolkitagent.nix
|
||||
./keybinds.nix
|
||||
./scratchpads.nix
|
||||
./windowrules.nix
|
||||
./xdg-portals.nix
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.sessionVariables = {
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
WLR_RENDERER_ALLOW_SOFTWARE = "1";
|
||||
XDG_CURRENT_DESKTOP = "Hyprland";
|
||||
XDG_SESSION_DESKTOP = "Hyprland";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
GDK_BACKEND = "wayland,x11,*";
|
||||
QT_QPA_PLATFORM = "wayland;xcb";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
SDL_VIDEODRIVER = "wayland";
|
||||
OZONE_PLATFORM = "wayland";
|
||||
CLUTTER_BACKEND = "wayland";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
# QT_QPA_PLATFORMTHEME = "qt6ct";
|
||||
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||
|
||||
# LIBVA_DRIVER_NAME = "nvidia";
|
||||
# GBM_BACKEND = "nvidia-drm";
|
||||
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
wl-clipboard-rs
|
||||
];
|
||||
|
||||
systemd.user.services = {
|
||||
waybar.Unit.After = lib.mkForce "graphical-session.target";
|
||||
|
||||
network-manager-applet.Unit.After = lib.mkForce "graphical-session.target";
|
||||
|
||||
fcitx5-daemon = {
|
||||
Unit.After = lib.mkForce "graphical-session.target";
|
||||
Service.Slice = "session.slice";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
ignore_dbus_inhibit = false;
|
||||
lock_cmd = "pidof hyprlock || ${config.programs.hyprlock.package}/bin/hyprlock";
|
||||
before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
after_sleep_cmd = "${cfg.finalPackage}/bin/hyprctl dispatch dpms on";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 900;
|
||||
on-timeout = "${config.programs.hyprlock.package}/bin/hyprlock";
|
||||
}
|
||||
{
|
||||
timeout = 1200;
|
||||
on-timeout = "${cfg.finalPackage}/bin/hyprctl dispatch dpms off";
|
||||
on-resume = "${cfg.finalPackage}/bin/hyprctl dispatch dpms on";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.hypridle = {
|
||||
Unit.After = lib.mkForce "graphical-session.target";
|
||||
Service.Slice = "session.slice";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
systemd.enable = false;
|
||||
systemd.enableXdgAutostart = false;
|
||||
|
||||
settings = {
|
||||
exec-once = [
|
||||
"uwsm finalize"
|
||||
];
|
||||
|
||||
monitor = [
|
||||
# TODO: host specific
|
||||
"eDP-1, 3840x2400@90.00Hz, 0x0, 2"
|
||||
|
||||
# PVV Demiurgen
|
||||
"desc:Hewlett Packard HP ZR24w CNT01711G6, 1920x1200, 0x-1200, 1"
|
||||
"desc:Hewlett Packard HP ZR24w CNT018103H, 1920x1200, 1920x-1200, 1"
|
||||
|
||||
# PVV Eirin
|
||||
"desc:Hewlett Packard HP ZR24w CNT01710L4, 1920x1200, 0x-1200, 1"
|
||||
"desc:Hewlett Packard HP ZR24w CNT0181039, 1920x1200, 1920x-1200, 1"
|
||||
|
||||
",preferred,auto,1"
|
||||
];
|
||||
|
||||
general = {
|
||||
gaps_in = 5;
|
||||
gaps_out = 15;
|
||||
|
||||
border_size = 2;
|
||||
|
||||
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
||||
"col.inactive_border" = "rgba(595959aa)";
|
||||
|
||||
resize_on_border = false;
|
||||
allow_tearing = false;
|
||||
layout = "master";
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
|
||||
# Change transparency of focused and unfocused windows
|
||||
active_opacity = 1.0;
|
||||
inactive_opacity = 1.0;
|
||||
|
||||
# drop_shadow = true;
|
||||
# shadow_range = 4;
|
||||
# shadow_render_power = 3;
|
||||
# "col.shadow" = "rgba(1a1a1aee)";
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#blur
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 3;
|
||||
passes = 1;
|
||||
|
||||
vibrancy = 0.1696;
|
||||
};
|
||||
};
|
||||
|
||||
animations.enabled = false;
|
||||
|
||||
master = {
|
||||
new_status = "slave";
|
||||
};
|
||||
|
||||
misc = {
|
||||
force_default_wallpaper = 0; # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
disable_hyprland_logo = false; # If true disables the random hyprland logo / anime girl background. :(
|
||||
};
|
||||
|
||||
input ={
|
||||
kb_layout = "us";
|
||||
kb_variant = "";
|
||||
kb_model = "";
|
||||
kb_options = "caps:escape";
|
||||
kb_rules = "";
|
||||
|
||||
follow_mouse = 1;
|
||||
|
||||
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
disable_loading_bar = true;
|
||||
grace = 0;
|
||||
hide_cursor = true;
|
||||
no_fade_in = false;
|
||||
};
|
||||
|
||||
background = [
|
||||
{
|
||||
path = "screenshot";
|
||||
blur_passes = 3;
|
||||
blur_size = 8;
|
||||
}
|
||||
];
|
||||
|
||||
input-field = [
|
||||
{
|
||||
size = "200, 50";
|
||||
position = "0, -80";
|
||||
monitor = "";
|
||||
dots_center = true;
|
||||
fade_on_empty = false;
|
||||
font_color = "rgb(202, 211, 245)";
|
||||
inner_color = "rgb(91, 96, 120)";
|
||||
outer_color = "rgb(24, 25, 38)";
|
||||
outline_thickness = 5;
|
||||
placeholder_text = ''Password...'';
|
||||
shadow_passes = 2;
|
||||
}
|
||||
];
|
||||
|
||||
auth = {
|
||||
"pam:enabled" = true;
|
||||
"pam:module" = "hyprlock";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
settings.ipc = true;
|
||||
};
|
||||
|
||||
systemd.user.services.hyprpaper = {
|
||||
Unit.After = lib.mkForce "graphical-session.target";
|
||||
Service.Slice = "session.slice";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.hyprpolkitagent.enable = true;
|
||||
|
||||
systemd.user.services.hyprpolkitagent = {
|
||||
Unit.After = lib.mkForce "graphical-session.target";
|
||||
Service.Slice = "session.slice";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = let
|
||||
exe = lib.getExe;
|
||||
in {
|
||||
"$mod" = "SUPER";
|
||||
|
||||
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
||||
bind = [
|
||||
"$mod SHIFT, Q, exec, uwsm stop"
|
||||
"$mod ALT SHIFT, Q, exec, ${pkgs.systemd}/bin/loginctl terminate-user \"${config.home.username}\""
|
||||
"$mod, R, exec, uwsm app -- ${exe config.programs.anyrun.package}"
|
||||
"$mod, T, togglefloating"
|
||||
|
||||
"$mod, F, fullscreenstate, 1"
|
||||
"$mod SHIFT, F, fullscreenstate, 3"
|
||||
"$mod, C, exec, ${cfg.finalPackage}/bin/hyprctl reload"
|
||||
|
||||
"$mod, BACKSPACE, killactive"
|
||||
|
||||
"$mod SHIFT, RETURN, exec, uwsm app -- ${exe pkgs.alacritty} --class termTerminal -e ${exe pkgs.tmux} new-session -A -s term"
|
||||
"$mod SHIFT, SPACE, exec, uwsm app -- ${exe pkgs.alacritty} --class termTerminal -e ${exe pkgs.tmux} new-session -A -s term"
|
||||
|
||||
"$mod, j, layoutmsg,cyclenext"
|
||||
"$mod, k, layoutmsg,cycleprev"
|
||||
"$mod SHIFT, j, layoutmsg, swapnext"
|
||||
"$mod SHIFT, k, layoutmsg, swapprev"
|
||||
|
||||
"$mod, 1, focusworkspaceoncurrentmonitor, 1"
|
||||
"$mod, 2, focusworkspaceoncurrentmonitor, 2"
|
||||
"$mod, 3, focusworkspaceoncurrentmonitor, 3"
|
||||
"$mod, 4, focusworkspaceoncurrentmonitor, 4"
|
||||
"$mod, 5, focusworkspaceoncurrentmonitor, 5"
|
||||
"$mod, 6, focusworkspaceoncurrentmonitor, 6"
|
||||
"$mod, 7, focusworkspaceoncurrentmonitor, 7"
|
||||
"$mod, 8, focusworkspaceoncurrentmonitor, 8"
|
||||
"$mod, 9, focusworkspaceoncurrentmonitor, 9"
|
||||
|
||||
"$mod SHIFT, 1, movetoworkspacesilent, 1"
|
||||
"$mod SHIFT, 2, movetoworkspacesilent, 2"
|
||||
"$mod SHIFT, 3, movetoworkspacesilent, 3"
|
||||
"$mod SHIFT, 4, movetoworkspacesilent, 4"
|
||||
"$mod SHIFT, 5, movetoworkspacesilent, 5"
|
||||
"$mod SHIFT, 6, movetoworkspacesilent, 6"
|
||||
"$mod SHIFT, 7, movetoworkspacesilent, 7"
|
||||
"$mod SHIFT, 8, movetoworkspacesilent, 8"
|
||||
"$mod SHIFT, 9, movetoworkspacesilent, 9"
|
||||
|
||||
"$mod, b, exec, ${pkgs.fcitx5}/bin/fcitx5-remote -s mozc"
|
||||
"$mod, n, exec, ${pkgs.fcitx5}/bin/fcitx5-remote -s keyboard-no"
|
||||
"$mod, m, exec, ${pkgs.fcitx5}/bin/fcitx5-remote -s keyboard-us"
|
||||
|
||||
"$mod, l, exec, ${pkgs.systemd}/bin/loginctl lock-session"
|
||||
|
||||
# TODO: fix
|
||||
# "super + minus" = "${pkgs.xcalib}/bin/xcalib -invert -alter"
|
||||
|
||||
", Print, exec, ${exe pkgs.grimblast} copy area"
|
||||
|
||||
# "SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} copy area"
|
||||
# "shift + @Print" = "${pkgs.maim}/bin/maim --hidecursor --nokeyboard $SCREENSHOT_DIR/$(date +%s).png"
|
||||
|
||||
"$mod, Print, exec, ${exe pkgs.woomer}"
|
||||
];
|
||||
|
||||
bindm = [
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, Control_L, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
"$mod, ALT_L, resizewindow"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
"$mod, p, exec, ${exe pkgs.mpc_cli} toggle"
|
||||
",XF86AudioPlay, exec, ${exe pkgs.mpc_cli} toggle"
|
||||
",XF86AudioPrev, exec, ${exe pkgs.mpc_cli} prev"
|
||||
",XF86AudioNext, exec, ${exe pkgs.mpc_cli} next"
|
||||
];
|
||||
|
||||
bindle = [
|
||||
",XF86MonBrightnessUp, exec, ${exe pkgs.brightnessctl} s +5%"
|
||||
",XF86MonBrightnessDown, exec, ${exe pkgs.brightnessctl} s 5%-"
|
||||
",XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||
",XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+"
|
||||
"$mod ,F7, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||
"$mod ,F8, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = let
|
||||
exe = lib.getExe;
|
||||
scratchpads = [
|
||||
(rec {
|
||||
title = "Floating terminal";
|
||||
class = "floatingTerminal";
|
||||
command = "uwsm app -- ${exe pkgs.alacritty} --class ${class} -e ${exe pkgs.tmux} new-session -A -s f";
|
||||
size = { h = 90; w = 95; };
|
||||
keys = [
|
||||
"$mod, RETURN"
|
||||
"$mod, SPACE"
|
||||
];
|
||||
})
|
||||
(rec {
|
||||
title = "Ncmpcpp";
|
||||
class = "floatingNcmpcpp";
|
||||
command = "uwsm app -- ${exe pkgs.alacritty} --class ${class} -e ${exe pkgs.ncmpcpp}";
|
||||
size = { h = 95; w = 95; };
|
||||
keys = [ "$mod, Q" ];
|
||||
})
|
||||
# "$mod, W, emacs"
|
||||
# "$mod, E, filebrowser"
|
||||
# "$mod, X, taskwarriortui"
|
||||
];
|
||||
in {
|
||||
bind = lib.pipe scratchpads [
|
||||
(map ({ keys, command, class, ... }:
|
||||
(map (key: let
|
||||
# TODO: rewrite this to take arguments instead of creating n copies
|
||||
invokeIfNotRunningAndToggleWorkspace = pkgs.writeShellApplication {
|
||||
name = "hyprland-toggle-scratchpad-${class}";
|
||||
runtimeInputs = [ cfg.finalPackage pkgs.jq ];
|
||||
text = ''
|
||||
SCRATCHPAD_PROGRAM_EXISTS=$(hyprctl clients -j | jq -r '[.[].class]|any(. == "${class}")')
|
||||
CURRENT_WORKSPACE_ID=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
|
||||
if [ "$SCRATCHPAD_PROGRAM_EXISTS" != "true" ]; then
|
||||
${command} &
|
||||
hyprctl dispatch movetoworkspacesilent "''${CURRENT_WORKSPACE_ID},class:${class}"
|
||||
hyprctl dispatch focuswindow "class:${class}"
|
||||
else
|
||||
SCRATCHPAD_PROGRAM_WORKSPACE_ID=$(hyprctl clients -j | jq '.[] | select( .class == "${class}") | .workspace.id')
|
||||
if [ "$SCRATCHPAD_PROGRAM_WORKSPACE_ID" != "$CURRENT_WORKSPACE_ID" ]; then
|
||||
hyprctl dispatch movetoworkspacesilent "''${CURRENT_WORKSPACE_ID},class:${class}"
|
||||
hyprctl dispatch focuswindow "class:${class}"
|
||||
else
|
||||
hyprctl dispatch movetoworkspacesilent "special:${class}Ws,class:${class}"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in "${key}, exec, ${lib.getExe invokeIfNotRunningAndToggleWorkspace}"
|
||||
) keys)
|
||||
))
|
||||
lib.flatten
|
||||
];
|
||||
|
||||
windowrulev2 = lib.pipe scratchpads [
|
||||
(map ({ class, size, ... }: [
|
||||
"workspace special:${class}Ws, class:^(${class})$"
|
||||
"float, class:^${class}$"
|
||||
"size ${toString size.w}% ${toString size.h}%, class:^(${class})$"
|
||||
"move ${toString ((100 - size.w) / 2)}% ${toString ((100 - size.h) / 2)}%, class:^(${class})$"
|
||||
]))
|
||||
lib.flatten
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings.windowrulev2 = [
|
||||
"float, class:^(Rofi)$"
|
||||
"float, class:^(xdg-desktop-portal-gtk)$"
|
||||
"float, title:^(.*Bitwarden Password Manager.*)$"
|
||||
"float, title:^(Picture-in-Picture)$"
|
||||
"tile, class:^(Nsxiv)$"
|
||||
|
||||
"float, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
"size 70%, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
"center, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
|
||||
"dimaround, class:^(xdg-desktop-portal-gtk)$"
|
||||
|
||||
"workspace special silent, title:^(Firefox — Sharing Indicator)$"
|
||||
"workspace special silent, title:^(Zen — Sharing Indicator)$"
|
||||
"workspace special silent, title:^(.*is sharing (your screen|a window)\.)$"
|
||||
|
||||
"workspace 2, class:^(firefox)$"
|
||||
"workspace 2, class:^(google-chrome)$"
|
||||
|
||||
"workspace 3, class:^(Emacs)$"
|
||||
"workspace 3, class:^(code)$"
|
||||
"workspace 3, class:^(code-url-handler)$"
|
||||
"workspace 3, class:^(dev.zed.Zed)$"
|
||||
|
||||
"workspace 5, class:^(discord)$"
|
||||
"workspace 5, class:^(Element)$"
|
||||
|
||||
"float, class:^(xdg-desktop-portal-termfilechooser)$"
|
||||
"size 70% 80%, class:^(xdg-desktop-portal-termfilechooser)$"
|
||||
"move 15% 10%, class:^(xdg-desktop-portal-termfilechooser)$"
|
||||
];
|
||||
};
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.hyprland;
|
||||
in {
|
||||
config = lib.mkIf cfg.enable {
|
||||
xdg.portal = {
|
||||
xdgOpenUsePortal = true;
|
||||
configPackages = with pkgs; [ gnome-session ];
|
||||
extraPortals = with pkgs; [
|
||||
gnome-keyring
|
||||
xdg-desktop-portal-gtk
|
||||
xdg-desktop-portal-termfilechooser
|
||||
];
|
||||
config.hyprland = {
|
||||
default = "hyprland;gtk;";
|
||||
"org.freedesktop.impl.portal.FileChooser" = [ "termfilechooser" ];
|
||||
"org.freedesktop.impl.portal.OpenURI" = [ "gtk" ];
|
||||
"org.freedesktop.impl.portal.Notification" = [ "gtk" ];
|
||||
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."xdg-desktop-portal-termfilechooser/config".source =
|
||||
(pkgs.formats.ini { listsAsDuplicateKeys = true; }).generate "xdg-desktop-portal-termfilechooser.ini" {
|
||||
filechooser = {
|
||||
cmd = "${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh";
|
||||
default_dir = "$HOME";
|
||||
env = [
|
||||
"TERMCMD=alacritty -T \"Filechooser\" --class \"xdg-desktop-portal-termfilechooser\" --command"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,32 +1,15 @@
|
||||
{ config, lib, ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
sops = {
|
||||
secrets = {
|
||||
"nix/access-tokens/github" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
|
||||
"nix/access-tokens/pvv-git" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
|
||||
"nix/access-tokens/github-nordicsemi" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
"nix/access-tokens/bitbucket-nordicsemi" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
"nix/access-tokens/github" = { sopsFile = ../../secrets/common.yaml; };
|
||||
"nix/access-tokens/pvv-git" = { sopsFile = ../../secrets/common.yaml; };
|
||||
};
|
||||
templates."nix-access-tokens.conf".content = let
|
||||
inherit (config.sops) placeholder;
|
||||
|
||||
tokens = {
|
||||
"github.com" = placeholder."nix/access-tokens/github";
|
||||
|
||||
"git.pvv.ntnu.no" = placeholder."nix/access-tokens/pvv-git";
|
||||
|
||||
"bitbucket.nordicsemi.no" = placeholder."nix/access-tokens/bitbucket-nordicsemi";
|
||||
"github.com/NordicPlayground" = placeholder."nix/access-tokens/github-nordicsemi";
|
||||
"github.com/NordicSemiconductor" = placeholder."nix/access-tokens/github-nordicsemi";
|
||||
};
|
||||
in "access-tokens = ${lib.pipe tokens [
|
||||
lib.attrsToList
|
||||
(builtins.sort (p: q: p.name > q.name))
|
||||
(map ({ name, value }: "${name}=${value}"))
|
||||
(builtins.concatStringsSep " ")
|
||||
]}";
|
||||
in ''
|
||||
access-tokens = github.com=${placeholder."nix/access-tokens/github"} git.pvv.ntnu.no=${placeholder."nix/access-tokens/pvv-git"}
|
||||
'';
|
||||
};
|
||||
|
||||
nix = {
|
||||
|
@ -37,334 +37,332 @@ in
|
||||
'';
|
||||
});
|
||||
|
||||
profiles.default = {
|
||||
userSettings = let
|
||||
editor = mapPrefixToSet "editor" {
|
||||
fontFamily = "Fira Code";
|
||||
fontLigatures = true;
|
||||
lineNumbers = "relative";
|
||||
mouseWheelZoom = false;
|
||||
fontSize = 14;
|
||||
"minimap.enabled" = false;
|
||||
tabSize = 2;
|
||||
insertSpaces = true;
|
||||
"inlineSuggest.enabled" = true;
|
||||
"inlayHints.enabled" = "offUnlessPressed";
|
||||
detectIndentation = false;
|
||||
tabCompletion = "onlySnippets";
|
||||
snippetSuggestions = "top";
|
||||
cursorBlinking = "smooth";
|
||||
cursorSmoothCaretAnimation = "on";
|
||||
multiCursorModifier = "ctrlCmd";
|
||||
suggestSelection = "first";
|
||||
cursorStyle = "line";
|
||||
wordSeparators = "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-";
|
||||
wordWrap = "off";
|
||||
# "bracketPairColorization.enabled" = true;
|
||||
};
|
||||
userSettings = let
|
||||
editor = mapPrefixToSet "editor" {
|
||||
fontFamily = "Fira Code";
|
||||
fontLigatures = true;
|
||||
lineNumbers = "relative";
|
||||
mouseWheelZoom = false;
|
||||
fontSize = 14;
|
||||
"minimap.enabled" = false;
|
||||
tabSize = 2;
|
||||
insertSpaces = true;
|
||||
"inlineSuggest.enabled" = true;
|
||||
"inlayHints.enabled" = "offUnlessPressed";
|
||||
detectIndentation = false;
|
||||
tabCompletion = "onlySnippets";
|
||||
snippetSuggestions = "top";
|
||||
cursorBlinking = "smooth";
|
||||
cursorSmoothCaretAnimation = "on";
|
||||
multiCursorModifier = "ctrlCmd";
|
||||
suggestSelection = "first";
|
||||
cursorStyle = "line";
|
||||
wordSeparators = "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-";
|
||||
wordWrap = "off";
|
||||
# "bracketPairColorization.enabled" = true;
|
||||
};
|
||||
|
||||
zen = mapPrefixToSet "zenMode" {
|
||||
centerLayout = true;
|
||||
hideStatusBar = false;
|
||||
hideLineNumbers = false;
|
||||
};
|
||||
zen = mapPrefixToSet "zenMode" {
|
||||
centerLayout = true;
|
||||
hideStatusBar = false;
|
||||
hideLineNumbers = false;
|
||||
};
|
||||
|
||||
vim = mapPrefixToSet "vim" {
|
||||
useSystemClipboard = true;
|
||||
"statusBarColorControl" = true;
|
||||
"statusBarColors.insert" = "#20ff00";
|
||||
"statusBarColors.normal" = "#1D1E20";
|
||||
"statusBarColors.visual" = "#00ffff";
|
||||
"statusBarColors.replace" = "#ff002b";
|
||||
handleKeys = {
|
||||
"<C-d>" = true;
|
||||
"<C-j>" = false;
|
||||
"<C-b>" = false;
|
||||
"<C-k>" = false;
|
||||
"<C-w>" = false;
|
||||
"<C-n>" = false;
|
||||
"<A-o>" = true;
|
||||
};
|
||||
};
|
||||
|
||||
workbench = mapPrefixToSet "workbench" {
|
||||
"settings.enableNaturalLanguageSearch" = false;
|
||||
enableExperiments = false;
|
||||
iconTheme = "material-icon-theme";
|
||||
colorTheme = "Monokai ST3";
|
||||
colorCustomizations = {
|
||||
"statusBar.background" = "#1D1E20";
|
||||
"statusBar.noFolderBackground" = "#1D1E20";
|
||||
"statusBar.debuggingBackground" = "#1D1E20";
|
||||
"[Monokai ST3]" = {
|
||||
"editor.foreground" = "#ffffff";
|
||||
};
|
||||
};
|
||||
editorAssociations = {
|
||||
"*.pdf" = "default";
|
||||
"*.ipynb" = "jupyter.notebook.ipynb";
|
||||
};
|
||||
};
|
||||
|
||||
python = mapPrefixToSet "python" {
|
||||
"analysis.completeFunctionParens" = true;
|
||||
"formatting.provider" = "yapf";
|
||||
"formatting.yapfArgs" = [
|
||||
"--style={based_on_style: pep8, indent_width: 2}"
|
||||
];
|
||||
"autoComplete.addBrackets" = true;
|
||||
languageServer = "Pylance";
|
||||
};
|
||||
|
||||
svg = mapPrefixToSet "svgviewer" {
|
||||
transparencygrid = true;
|
||||
enableautopreview = true;
|
||||
previewcolumn = "Beside";
|
||||
showzoominout = true;
|
||||
};
|
||||
|
||||
indentRainbow = mapPrefixToSet "indentRainbow" {
|
||||
errorColor= "rgb(255, 0, 0)";
|
||||
colors = [ # http://colrd.com/palette/38436/
|
||||
"rgba(26, 19, 52, 0.1)"
|
||||
"rgba(1, 84, 90, 0.1)"
|
||||
"rgba(3, 195, 131, 0.1)"
|
||||
"rgba(251, 191, 69, 0.1)"
|
||||
"rgba(237, 3, 69, 0.1)"
|
||||
"rgba(113, 1, 98, 0.1)"
|
||||
"rgba(2, 44, 125, 0.1)"
|
||||
"rgba(38, 41, 74, 0.1)"
|
||||
"rgba(1, 115, 81, 0.1)"
|
||||
"rgba(170, 217, 98, 0.1)"
|
||||
"rgba(239, 106, 50, 0.1)"
|
||||
"rgba(161, 42, 94, 0.1)"
|
||||
];
|
||||
ignoreErrorLanguages = [
|
||||
"markdown"
|
||||
"haskell"
|
||||
"elm"
|
||||
"fsharp"
|
||||
"java"
|
||||
];
|
||||
};
|
||||
|
||||
in
|
||||
editor //
|
||||
indentRainbow //
|
||||
python //
|
||||
svg //
|
||||
workbench //
|
||||
vim // # This needs to come after workbench because of setting ordering
|
||||
zen //
|
||||
{
|
||||
"extensions.autoCheckUpdates" = false;
|
||||
"extensions.autoUpdate" = false;
|
||||
"diffEditor.ignoreTrimWhitespace" = false;
|
||||
"diffEditor.hideUnchangedRegions" = "enabled";
|
||||
"emmet.triggerExpansionOnTab" = true;
|
||||
"explorer.confirmDragAndDrop" = false;
|
||||
"git.allowForcePush" = true;
|
||||
"git.autofetch" = true;
|
||||
"telemetry.telemetryLevel" = "off";
|
||||
"terminal.integrated.fontSize" = 14;
|
||||
"vsintellicode.modify.editor.suggestSelection" = "automaticallyOverrodeDefaultValue";
|
||||
"keyboard.dispatch" = "keyCode";
|
||||
"window.zoomLevel" = 1;
|
||||
|
||||
"search.exclude" = {
|
||||
"**/node_modules" = true;
|
||||
"**/bower_components" = true;
|
||||
"**/*.code-search" = true;
|
||||
"**/.direnv/" = true;
|
||||
};
|
||||
|
||||
# This setting does not support language overrides
|
||||
"files.exclude" = {
|
||||
# Java
|
||||
"**/.classpath" = true;
|
||||
"**/.project" = true;
|
||||
"**/.settings" = true;
|
||||
"**/.factorypath" = true;
|
||||
};
|
||||
|
||||
# Extensions
|
||||
|
||||
"bracket-pair-colorizer-2.colorMode" = "Consecutive";
|
||||
"bracket-pair-colorizer-2.forceIterationColorCycle" = true;
|
||||
"bracket-pair-colorizer-2.colors" = [
|
||||
"#fff200"
|
||||
"#3d33ff"
|
||||
"#ff57d5"
|
||||
"#00ff11"
|
||||
"#ff8400"
|
||||
"#ff0030"
|
||||
];
|
||||
|
||||
"errorLens.errorBackground" = "rgba(240,0,0,0.1)";
|
||||
"errorLens.warningBackground" = "rgba(180,180,0,0.1)";
|
||||
|
||||
"liveshare.presence" = true;
|
||||
"liveshare.showInStatusBar" = "whileCollaborating";
|
||||
|
||||
"liveServer.settings.port" = 5500;
|
||||
|
||||
"material-icon-theme.folders.associations" = {
|
||||
ui = "layout";
|
||||
bloc = "controller";
|
||||
};
|
||||
|
||||
"redhat.telemetry.enabled" = false;
|
||||
|
||||
"[html]" = {
|
||||
"editor.formatOnSave" = false;
|
||||
"editor.defaultFormatter" = "vscode.html-language-features";
|
||||
};
|
||||
|
||||
"[javascript]" = {
|
||||
"editor.formatOnSave" = false;
|
||||
"editor.defaultFormatter" = "vscode.typescript-language-features";
|
||||
};
|
||||
|
||||
"[json]" = {
|
||||
"editor.formatOnSave" = true;
|
||||
"editor.defaultFormatter" = "vscode.json-language-features";
|
||||
};
|
||||
|
||||
"[jsonc]" = {
|
||||
"editor.defaultFormatter" = "vscode.json-language-features";
|
||||
vim = mapPrefixToSet "vim" {
|
||||
useSystemClipboard = true;
|
||||
"statusBarColorControl" = true;
|
||||
"statusBarColors.insert" = "#20ff00";
|
||||
"statusBarColors.normal" = "#1D1E20";
|
||||
"statusBarColors.visual" = "#00ffff";
|
||||
"statusBarColors.replace" = "#ff002b";
|
||||
handleKeys = {
|
||||
"<C-d>" = true;
|
||||
"<C-j>" = false;
|
||||
"<C-b>" = false;
|
||||
"<C-k>" = false;
|
||||
"<C-w>" = false;
|
||||
"<C-n>" = false;
|
||||
"<A-o>" = true;
|
||||
};
|
||||
};
|
||||
|
||||
keybindings = [
|
||||
{
|
||||
key = "alt+k";
|
||||
when = "codeActionMenuVisible";
|
||||
command = "selectPrevCodeAction";
|
||||
}
|
||||
workbench = mapPrefixToSet "workbench" {
|
||||
"settings.enableNaturalLanguageSearch" = false;
|
||||
enableExperiments = false;
|
||||
iconTheme = "material-icon-theme";
|
||||
colorTheme = "Monokai ST3";
|
||||
colorCustomizations = {
|
||||
"statusBar.background" = "#1D1E20";
|
||||
"statusBar.noFolderBackground" = "#1D1E20";
|
||||
"statusBar.debuggingBackground" = "#1D1E20";
|
||||
"[Monokai ST3]" = {
|
||||
"editor.foreground" = "#ffffff";
|
||||
};
|
||||
};
|
||||
editorAssociations = {
|
||||
"*.pdf" = "default";
|
||||
"*.ipynb" = "jupyter.notebook.ipynb";
|
||||
};
|
||||
};
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
when = "codeActionMenuVisible";
|
||||
command = "selectNextCodeAction";
|
||||
}
|
||||
python = mapPrefixToSet "python" {
|
||||
"analysis.completeFunctionParens" = true;
|
||||
"formatting.provider" = "yapf";
|
||||
"formatting.yapfArgs" = [
|
||||
"--style={based_on_style: pep8, indent_width: 2}"
|
||||
];
|
||||
"autoComplete.addBrackets" = true;
|
||||
languageServer = "Pylance";
|
||||
};
|
||||
|
||||
{
|
||||
key = "alt+k";
|
||||
command = "selectPrevSuggestion";
|
||||
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus";
|
||||
}
|
||||
svg = mapPrefixToSet "svgviewer" {
|
||||
transparencygrid = true;
|
||||
enableautopreview = true;
|
||||
previewcolumn = "Beside";
|
||||
showzoominout = true;
|
||||
};
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
command = "selectNextSuggestion";
|
||||
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus";
|
||||
}
|
||||
indentRainbow = mapPrefixToSet "indentRainbow" {
|
||||
errorColor= "rgb(255, 0, 0)";
|
||||
colors = [ # http://colrd.com/palette/38436/
|
||||
"rgba(26, 19, 52, 0.1)"
|
||||
"rgba(1, 84, 90, 0.1)"
|
||||
"rgba(3, 195, 131, 0.1)"
|
||||
"rgba(251, 191, 69, 0.1)"
|
||||
"rgba(237, 3, 69, 0.1)"
|
||||
"rgba(113, 1, 98, 0.1)"
|
||||
"rgba(2, 44, 125, 0.1)"
|
||||
"rgba(38, 41, 74, 0.1)"
|
||||
"rgba(1, 115, 81, 0.1)"
|
||||
"rgba(170, 217, 98, 0.1)"
|
||||
"rgba(239, 106, 50, 0.1)"
|
||||
"rgba(161, 42, 94, 0.1)"
|
||||
];
|
||||
ignoreErrorLanguages = [
|
||||
"markdown"
|
||||
"haskell"
|
||||
"elm"
|
||||
"fsharp"
|
||||
"java"
|
||||
];
|
||||
};
|
||||
|
||||
{
|
||||
key = "alt+k";
|
||||
command = "editor.action.moveLinesUpAction";
|
||||
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible";
|
||||
}
|
||||
in
|
||||
editor //
|
||||
indentRainbow //
|
||||
python //
|
||||
svg //
|
||||
workbench //
|
||||
vim // # This needs to come after workbench because of setting ordering
|
||||
zen //
|
||||
{
|
||||
"extensions.autoCheckUpdates" = false;
|
||||
"extensions.autoUpdate" = false;
|
||||
"diffEditor.ignoreTrimWhitespace" = false;
|
||||
"diffEditor.hideUnchangedRegions" = "enabled";
|
||||
"emmet.triggerExpansionOnTab" = true;
|
||||
"explorer.confirmDragAndDrop" = false;
|
||||
"git.allowForcePush" = true;
|
||||
"git.autofetch" = true;
|
||||
"telemetry.telemetryLevel" = "off";
|
||||
"terminal.integrated.fontSize" = 14;
|
||||
"vsintellicode.modify.editor.suggestSelection" = "automaticallyOverrodeDefaultValue";
|
||||
"keyboard.dispatch" = "keyCode";
|
||||
"window.zoomLevel" = 1;
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
command = "editor.action.moveLinesDownAction";
|
||||
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible";
|
||||
}
|
||||
"search.exclude" = {
|
||||
"**/node_modules" = true;
|
||||
"**/bower_components" = true;
|
||||
"**/*.code-search" = true;
|
||||
"**/.direnv/" = true;
|
||||
};
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
command = "workbench.action.quickOpenNavigateNext";
|
||||
when = "inQuickOpen";
|
||||
}
|
||||
# This setting does not support language overrides
|
||||
"files.exclude" = {
|
||||
# Java
|
||||
"**/.classpath" = true;
|
||||
"**/.project" = true;
|
||||
"**/.settings" = true;
|
||||
"**/.factorypath" = true;
|
||||
};
|
||||
|
||||
{
|
||||
key = "alt+k";
|
||||
command = "workbench.action.quickOpenNavigatePrevious";
|
||||
when = "inQuickOpen";
|
||||
}
|
||||
# Extensions
|
||||
|
||||
{
|
||||
key = "alt+f";
|
||||
command = "editor.action.formatDocument";
|
||||
when = "editorTextFocus && !editorReadonly";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+o";
|
||||
command = "editor.action.insertLineAfter";
|
||||
when = "textInputFocus && !editorReadonly";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+shift+o";
|
||||
command = "editor.action.insertLineBefore";
|
||||
when = "textInputFocus && !editorReadonly";
|
||||
}
|
||||
"bracket-pair-colorizer-2.colorMode" = "Consecutive";
|
||||
"bracket-pair-colorizer-2.forceIterationColorCycle" = true;
|
||||
"bracket-pair-colorizer-2.colors" = [
|
||||
"#fff200"
|
||||
"#3d33ff"
|
||||
"#ff57d5"
|
||||
"#00ff11"
|
||||
"#ff8400"
|
||||
"#ff0030"
|
||||
];
|
||||
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
# WakaTime.vscode-wakatime
|
||||
# dotjoshjohnson.xml
|
||||
# eamodio.gitlens
|
||||
# jock.svg
|
||||
# ms-azuretools.vscode-docker
|
||||
# ms-toolsai.jupyter
|
||||
# ms-vscode-remote.remote-ssh
|
||||
# ms-vsliveshare.vsliveshare
|
||||
bbenoist.nix
|
||||
christian-kohler.path-intellisense
|
||||
# coenraads.bracket-pair-colorizer-2
|
||||
haskell.haskell
|
||||
justusadam.language-haskell
|
||||
justusadam.language-haskell
|
||||
mechatroner.rainbow-csv
|
||||
mhutchie.git-graph
|
||||
ms-python.python
|
||||
ms-python.vscode-pylance
|
||||
ms-vscode-remote.remote-ssh
|
||||
naumovs.color-highlight
|
||||
oderwat.indent-rainbow
|
||||
pkief.material-icon-theme
|
||||
redhat.vscode-yaml
|
||||
shardulm94.trailing-spaces
|
||||
usernamehw.errorlens
|
||||
rust-lang.rust-analyzer
|
||||
mkhl.direnv
|
||||
waderyan.gitblame
|
||||
vscodevim.vim
|
||||
hbenl.vscode-test-explorer
|
||||
# vitaliymaz.vscode-svg-previewer
|
||||
ms-vscode.test-adapter-converter
|
||||
visualstudioexptteam.vscodeintellicode
|
||||
tamasfe.even-better-toml
|
||||
maximedenes.vscoq
|
||||
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
{
|
||||
name = "monokai-st3";
|
||||
publisher = "AndreyVolosovich";
|
||||
version = "0.2.0";
|
||||
sha256 = "1rvz5hlrfshy9laybxzvrdklx328s13j0lb8ljbda9zkadi3wcad";
|
||||
}
|
||||
{
|
||||
name = "comment-anchors";
|
||||
publisher = "ExodiusStudios";
|
||||
version = "1.10.4";
|
||||
sha256 = "sha256-FvfjPpQsgCsnY1BylhLCM/qDQChf9/iTr3cKkCGfMVI=";
|
||||
}
|
||||
{
|
||||
name = "vscode-gutter-preview";
|
||||
publisher = "kisstkondoros";
|
||||
version = "0.31.2";
|
||||
sha256 = "sha256-2/RvDSsVL06UmNG9HchXaJMJ4FYtnpuJ2Bn53JVv1t8=";
|
||||
}
|
||||
{
|
||||
name = "keyboard-quickfix";
|
||||
publisher = "pascalsenn";
|
||||
version = "0.0.6";
|
||||
sha256 = "BK7ND6gtRVEitxaokJHmQ5rvSOgssVz+s9dktGQnY6M=";
|
||||
}
|
||||
];
|
||||
"errorLens.errorBackground" = "rgba(240,0,0,0.1)";
|
||||
"errorLens.warningBackground" = "rgba(180,180,0,0.1)";
|
||||
|
||||
"liveshare.presence" = true;
|
||||
"liveshare.showInStatusBar" = "whileCollaborating";
|
||||
|
||||
"liveServer.settings.port" = 5500;
|
||||
|
||||
"material-icon-theme.folders.associations" = {
|
||||
ui = "layout";
|
||||
bloc = "controller";
|
||||
};
|
||||
|
||||
"redhat.telemetry.enabled" = false;
|
||||
|
||||
"[html]" = {
|
||||
"editor.formatOnSave" = false;
|
||||
"editor.defaultFormatter" = "vscode.html-language-features";
|
||||
};
|
||||
|
||||
"[javascript]" = {
|
||||
"editor.formatOnSave" = false;
|
||||
"editor.defaultFormatter" = "vscode.typescript-language-features";
|
||||
};
|
||||
|
||||
"[json]" = {
|
||||
"editor.formatOnSave" = true;
|
||||
"editor.defaultFormatter" = "vscode.json-language-features";
|
||||
};
|
||||
|
||||
"[jsonc]" = {
|
||||
"editor.defaultFormatter" = "vscode.json-language-features";
|
||||
};
|
||||
};
|
||||
|
||||
keybindings = [
|
||||
{
|
||||
key = "alt+k";
|
||||
when = "codeActionMenuVisible";
|
||||
command = "selectPrevCodeAction";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
when = "codeActionMenuVisible";
|
||||
command = "selectNextCodeAction";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+k";
|
||||
command = "selectPrevSuggestion";
|
||||
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
command = "selectNextSuggestion";
|
||||
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+k";
|
||||
command = "editor.action.moveLinesUpAction";
|
||||
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
command = "editor.action.moveLinesDownAction";
|
||||
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
command = "workbench.action.quickOpenNavigateNext";
|
||||
when = "inQuickOpen";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+k";
|
||||
command = "workbench.action.quickOpenNavigatePrevious";
|
||||
when = "inQuickOpen";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+f";
|
||||
command = "editor.action.formatDocument";
|
||||
when = "editorTextFocus && !editorReadonly";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+o";
|
||||
command = "editor.action.insertLineAfter";
|
||||
when = "textInputFocus && !editorReadonly";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+shift+o";
|
||||
command = "editor.action.insertLineBefore";
|
||||
when = "textInputFocus && !editorReadonly";
|
||||
}
|
||||
];
|
||||
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
# WakaTime.vscode-wakatime
|
||||
# dotjoshjohnson.xml
|
||||
# eamodio.gitlens
|
||||
# jock.svg
|
||||
# ms-azuretools.vscode-docker
|
||||
# ms-toolsai.jupyter
|
||||
# ms-vscode-remote.remote-ssh
|
||||
# ms-vsliveshare.vsliveshare
|
||||
bbenoist.nix
|
||||
christian-kohler.path-intellisense
|
||||
# coenraads.bracket-pair-colorizer-2
|
||||
haskell.haskell
|
||||
justusadam.language-haskell
|
||||
justusadam.language-haskell
|
||||
mechatroner.rainbow-csv
|
||||
mhutchie.git-graph
|
||||
ms-python.python
|
||||
ms-python.vscode-pylance
|
||||
ms-vscode-remote.remote-ssh
|
||||
naumovs.color-highlight
|
||||
oderwat.indent-rainbow
|
||||
pkief.material-icon-theme
|
||||
redhat.vscode-yaml
|
||||
shardulm94.trailing-spaces
|
||||
usernamehw.errorlens
|
||||
rust-lang.rust-analyzer
|
||||
mkhl.direnv
|
||||
waderyan.gitblame
|
||||
vscodevim.vim
|
||||
hbenl.vscode-test-explorer
|
||||
# vitaliymaz.vscode-svg-previewer
|
||||
ms-vscode.test-adapter-converter
|
||||
visualstudioexptteam.vscodeintellicode
|
||||
tamasfe.even-better-toml
|
||||
maximedenes.vscoq
|
||||
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
{
|
||||
name = "monokai-st3";
|
||||
publisher = "AndreyVolosovich";
|
||||
version = "0.2.0";
|
||||
sha256 = "1rvz5hlrfshy9laybxzvrdklx328s13j0lb8ljbda9zkadi3wcad";
|
||||
}
|
||||
{
|
||||
name = "comment-anchors";
|
||||
publisher = "ExodiusStudios";
|
||||
version = "1.10.4";
|
||||
sha256 = "sha256-FvfjPpQsgCsnY1BylhLCM/qDQChf9/iTr3cKkCGfMVI=";
|
||||
}
|
||||
{
|
||||
name = "vscode-gutter-preview";
|
||||
publisher = "kisstkondoros";
|
||||
version = "0.31.2";
|
||||
sha256 = "sha256-2/RvDSsVL06UmNG9HchXaJMJ4FYtnpuJ2Bn53JVv1t8=";
|
||||
}
|
||||
{
|
||||
name = "keyboard-quickfix";
|
||||
publisher = "pascalsenn";
|
||||
version = "0.0.6";
|
||||
sha256 = "BK7ND6gtRVEitxaokJHmQ5rvSOgssVz+s9dktGQnY6M=";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
keymap = {
|
||||
manager.prepend_keymap = [
|
||||
{
|
||||
run = "quit --no-cwd-file";
|
||||
on = [ "<Esc>" ];
|
||||
desc = "Quit without outputting cwd-file";
|
||||
}
|
||||
];
|
||||
pick.prepend_keymap = [
|
||||
{
|
||||
run = "close";
|
||||
on = [ "<Esc>" ];
|
||||
desc = "Quit without submitting the picker";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -5,13 +5,6 @@
|
||||
|
||||
package = unstable-pkgs.zed-editor;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
gopls
|
||||
groovy
|
||||
nixd
|
||||
pyright
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
load_direnv = "shell_hook";
|
||||
base_keymap = "VSCode";
|
||||
@ -104,27 +97,11 @@
|
||||
tab_size = 2;
|
||||
format_on_save = "off";
|
||||
};
|
||||
Python = {
|
||||
language_servers = [ "pyright" "ruff" ];
|
||||
format_on_save = "off";
|
||||
formatter = [
|
||||
{
|
||||
code_actions = {
|
||||
"source.organizeImports.ruff" = true;
|
||||
"source.fixAll.ruff" = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
language_server.name = "ruff";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
rust-analyzer.binary.path_lookup = true;
|
||||
nix.binary.path_lookup = true;
|
||||
nixd = { };
|
||||
};
|
||||
};
|
||||
|
||||
@ -183,7 +160,7 @@
|
||||
};
|
||||
in "${package}/themes/monokai.json";
|
||||
|
||||
programs.zsh.initContent = ''
|
||||
programs.zsh.initExtra = ''
|
||||
if [[ "$ZED_TERM" == "true" && -n "$TMUX_PANE" ]]; then
|
||||
unset TMUX_PANE
|
||||
fi
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.programs.zsh;
|
||||
in
|
||||
@ -16,18 +16,18 @@ in
|
||||
})}
|
||||
'';
|
||||
|
||||
systemd.user.tmpfiles.settings."10-zsh"."${config.xdg.cacheHome}/zsh".d = {
|
||||
mode = "0770";
|
||||
user = config.home.username;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
|
||||
enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
# enableSyntaxHighlighting = true;
|
||||
defaultKeymap = "viins";
|
||||
enableCompletion = true;
|
||||
|
||||
initExtraBeforeCompInit = ''
|
||||
fpath+=(${pkgs.zsh-completions}/share/zsh/site-functions)
|
||||
'';
|
||||
|
||||
completionInit = "";
|
||||
|
||||
history = {
|
||||
@ -73,24 +73,19 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
initContent = lib.mkMerge [
|
||||
(lib.mkOrder 550 ''
|
||||
fpath+=(${pkgs.zsh-completions}/share/zsh/site-functions)
|
||||
'')
|
||||
''
|
||||
source ${./p10k.zsh}
|
||||
initExtra = ''
|
||||
source ${./p10k.zsh}
|
||||
|
||||
enable-fzf-tab
|
||||
enable-fzf-tab
|
||||
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${lib.getExe pkgs.eza} -1 --color=always $realpath'
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${lib.getExe pkgs.eza} -1 --color=always $realpath'
|
||||
|
||||
# Use tmux buffer if we are inside tmux
|
||||
if ! { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } then
|
||||
zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
|
||||
fi
|
||||
# Use tmux buffer if we are inside tmux
|
||||
if ! { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } then
|
||||
zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
|
||||
fi
|
||||
|
||||
source "${config.xdg.configHome}/mutable_env.sh"
|
||||
''
|
||||
];
|
||||
source "${config.xdg.configHome}/mutable_env.sh"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
@ -6,16 +6,12 @@ let
|
||||
in
|
||||
{
|
||||
i18n.inputMethod = {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5 = {
|
||||
waylandFrontend = true;
|
||||
addons = with pkgs; [
|
||||
fcitx5-mozc
|
||||
fcitx5-gtk
|
||||
# fcitx5-chinese-addons
|
||||
];
|
||||
};
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-mozc
|
||||
fcitx5-gtk
|
||||
# fcitx5-chinese-addons
|
||||
];
|
||||
};
|
||||
|
||||
xdg.configFile = let
|
||||
@ -132,6 +128,12 @@ in
|
||||
source = "${pkgs.fcitx5-material-color}/share/fcitx5/themes/Material-Color-orange";
|
||||
};
|
||||
|
||||
# TODO: set i18n.inputMethod.fcitx5.waylandFrontend on home-manager 25.05
|
||||
home.sessionVariables = {
|
||||
GTK_IM_MODULE = lib.mkForce "";
|
||||
QT_IM_MODULE = lib.mkForce "";
|
||||
};
|
||||
|
||||
systemd.user.services.fcitx5-daemon = {
|
||||
Service.Restart="on-failure";
|
||||
Service.ExecStart = lib.mkForce "${fcitx5Package}/bin/fcitx5";
|
||||
|
@ -1,9 +1,4 @@
|
||||
{ config, lib, machineVars, ... }:
|
||||
let
|
||||
cfg = config.services.gnome-keyring;
|
||||
in
|
||||
{ machineVars, ... }:
|
||||
{
|
||||
services.gnome-keyring.enable = !machineVars.headless;
|
||||
|
||||
systemd.user.services.gnome-keyring.Service.Slice = lib.mkIf cfg.enable "session.slice";
|
||||
}
|
||||
}
|
@ -100,8 +100,8 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.settings."10-mpd".${cfg.dataDir}."d" = {
|
||||
user = config.home.username;
|
||||
};
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"d ${cfg.dataDir} - ${config.home.username} - - -"
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -27,14 +27,13 @@ in {
|
||||
source "${config.sops.secrets."nordicsemi/envvars".path}"
|
||||
'';
|
||||
|
||||
# programs.nushell.extraEnv = ''
|
||||
# source "${config.sops.secrets."nordicsemi/envvars".path}"
|
||||
# '';
|
||||
programs.nushell.extraEnv = ''
|
||||
source "${config.sops.secrets."nordicsemi/envvars".path}"
|
||||
'';
|
||||
|
||||
systemd.user.tmpfiles.settings."10-shell"."${config.xdg.configHome}/mutable_env.sh".f = {
|
||||
user = config.home.username;
|
||||
mode = "0700";
|
||||
};
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"f ${config.xdg.configHome}/mutable_env.sh 0700 ${config.home.username} - - -"
|
||||
];
|
||||
|
||||
local.shell.aliases = {
|
||||
|
||||
@ -370,35 +369,26 @@ in {
|
||||
# Code generated commands
|
||||
|
||||
"Generated" = {
|
||||
"cds" = lib.pipe (lib.range 1 9) [
|
||||
(map
|
||||
(n: {
|
||||
realCommand = "cd " + (builtins.concatStringsSep "/" (lib.replicate n ".."));
|
||||
aliases = [
|
||||
("cd" + (lib.strings.replicate (n + 1) "."))
|
||||
("cd." + toString n)
|
||||
(lib.strings.replicate (n + 1) ".")
|
||||
("." + toString n)
|
||||
(".." + toString n)
|
||||
];
|
||||
})
|
||||
)
|
||||
(map
|
||||
({ realCommand, aliases }: map (alias: {
|
||||
name = alias;
|
||||
value = {
|
||||
alias = [ realCommand ];
|
||||
shells = [
|
||||
"bash"
|
||||
"zsh"
|
||||
"fish"
|
||||
];
|
||||
};
|
||||
}) aliases)
|
||||
)
|
||||
builtins.concatLists
|
||||
builtins.listToAttrs
|
||||
];
|
||||
"cds" = let
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (extendedLib.strings) repeatString;
|
||||
|
||||
inherit (lib.lists) range flatten replicate;
|
||||
inherit (lib.attrsets) nameValuePair listToAttrs;
|
||||
|
||||
nthCds = n: [
|
||||
("cd" + (repeatString "." (n + 1)))
|
||||
("cd." + toString n)
|
||||
(repeatString "." (n + 1))
|
||||
("." + toString n)
|
||||
(".." + toString n)
|
||||
];
|
||||
realCommand = n: "cd " + (concatStringsSep "/" (replicate n ".."));
|
||||
|
||||
nthCdsAsNameValuePairs = n: map (cmd: nameValuePair cmd (realCommand n)) (nthCds n);
|
||||
allCdNameValuePairs = flatten (map nthCdsAsNameValuePairs (range 1 9));
|
||||
in
|
||||
listToAttrs allCdNameValuePairs;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -6,7 +6,6 @@ in {
|
||||
./fonts.nix
|
||||
./nix.nix
|
||||
|
||||
./programs/dconf.nix
|
||||
./programs/gnupg.nix
|
||||
./programs/neovim.nix
|
||||
./programs/nix-ld.nix
|
||||
@ -16,10 +15,7 @@ in {
|
||||
|
||||
./services/blueman.nix
|
||||
./services/dbus.nix
|
||||
./services/display-manager.nix
|
||||
./services/docker.nix
|
||||
./services/fwupd.nix
|
||||
./services/gnome-keyring.nix
|
||||
./services/irqbalance.nix
|
||||
./services/journald.nix
|
||||
./services/libinput.nix
|
||||
@ -141,6 +137,8 @@ in {
|
||||
};
|
||||
|
||||
services = {
|
||||
gnome.gnome-keyring.enable = !config.machineVars.headless;
|
||||
|
||||
udev.packages = with pkgs; [
|
||||
yubikey-personalization
|
||||
android-udev-rules
|
||||
@ -279,4 +277,11 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.docker.enableOnBoot = lib.mkDefault false;
|
||||
virtualisation.docker.autoPrune = {
|
||||
enable = lib.mkDefault true;
|
||||
flags = [ "--system" "--all" ];
|
||||
dates = "daily";
|
||||
};
|
||||
}
|
||||
|
@ -16,8 +16,6 @@
|
||||
ipafont
|
||||
liberation_ttf
|
||||
migmix
|
||||
nerd-fonts._0xproto
|
||||
nerd-fonts.droid-sans-mono
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
@ -32,6 +30,7 @@
|
||||
ubuntu_font_family
|
||||
victor-mono
|
||||
yasashisa-gothic
|
||||
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
|
||||
];
|
||||
|
||||
fontconfig = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ config, lib, unstable-pkgs, ... }:
|
||||
{ config, unstable-pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./nix-builders/bob.nix
|
||||
@ -9,30 +9,13 @@
|
||||
sops = {
|
||||
secrets = {
|
||||
"nix/access-tokens/github" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
|
||||
"nix/access-tokens/pvv-git" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
|
||||
"nix/access-tokens/github-nordicsemi" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
"nix/access-tokens/bitbucket-nordicsemi" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
};
|
||||
templates."nix-access-tokens.conf".content = let
|
||||
inherit (config.sops) placeholder;
|
||||
|
||||
tokens = {
|
||||
"github.com" = placeholder."nix/access-tokens/github";
|
||||
|
||||
"git.pvv.ntnu.no" = placeholder."nix/access-tokens/pvv-git";
|
||||
|
||||
"bitbucket.nordicsemi.no" = placeholder."nix/access-tokens/bitbucket-nordicsemi";
|
||||
"github.com/NordicPlayground" = placeholder."nix/access-tokens/github-nordicsemi";
|
||||
"github.com/NordicSemiconductor" = placeholder."nix/access-tokens/github-nordicsemi";
|
||||
};
|
||||
in "access-tokens = ${lib.pipe tokens [
|
||||
lib.attrsToList
|
||||
(builtins.sort (p: q: p.name > q.name))
|
||||
(map ({ name, value }: "${name}=${value}"))
|
||||
(builtins.concatStringsSep " ")
|
||||
]}";
|
||||
in ''
|
||||
access-tokens = github.com=${placeholder."nix/access-tokens/github"} git.pvv.ntnu.no=${placeholder."nix/access-tokens/pvv-git"}
|
||||
'';
|
||||
};
|
||||
|
||||
nix = {
|
||||
|
@ -1,9 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.dconf;
|
||||
in
|
||||
{
|
||||
programs.dconf.enable = !config.machineVars.headless;
|
||||
|
||||
systemd.user.services.dconf.serviceConfig.slice = lib.mkIf cfg.enable "session.slice";
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
implementation = "broker";
|
||||
packages = with pkgs; [
|
||||
gcr
|
||||
dconf
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.displayManager;
|
||||
in
|
||||
{
|
||||
services.displayManager = lib.mkIf (!config.machineVars.headless) {
|
||||
enable = true;
|
||||
defaultSession = if config.machineVars.wayland
|
||||
then "hyprland-uwsm"
|
||||
else "none+xmonad";
|
||||
sddm = {
|
||||
enable = true;
|
||||
wayland.enable = config.machineVars.wayland;
|
||||
package = pkgs.kdePackages.sddm;
|
||||
theme = "sddm-astronaut-theme";
|
||||
extraPackages = with pkgs.kdePackages; [
|
||||
qt5compat
|
||||
qtmultimedia
|
||||
# pkgs.sddm-astronaut
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = lib.mkIf (cfg.enable && cfg.sddm.enable) [
|
||||
(pkgs.sddm-astronaut.override {
|
||||
themeConfig = {
|
||||
PartialBlur = false;
|
||||
# Background = "Backgrounds/";
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.virtualisation.docker;
|
||||
in
|
||||
{
|
||||
virtualisation.docker.enableOnBoot = lib.mkDefault false;
|
||||
virtualisation.docker.autoPrune = {
|
||||
enable = lib.mkDefault cfg.enable;
|
||||
flags = [ "--all" ];
|
||||
dates = "daily";
|
||||
};
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.services.gnome.gnome-keyring;
|
||||
in
|
||||
{
|
||||
services.gnome.gnome-keyring.enable = !config.machineVars.headless;
|
||||
|
||||
systemd.user.services.gnome-keyring.serviceConfig.Slice = lib.mkIf cfg.enable "session.slice";
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
services.locate = {
|
||||
enable = true;
|
||||
package = pkgs.plocate;
|
||||
localuser = null;
|
||||
pruneNames = [
|
||||
".bzr"
|
||||
".cache"
|
||||
|
@ -1,59 +1,4 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.uptimed;
|
||||
in
|
||||
{ ... }:
|
||||
{
|
||||
options.services.uptimed.settings = lib.mkOption {
|
||||
description = "";
|
||||
default = { };
|
||||
type = lib.types.submodule {
|
||||
freeformType = with lib.types; attrsOf (either str (listOf str));
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
services.uptimed = {
|
||||
enable = true;
|
||||
|
||||
settings = let
|
||||
stateDir = "/var/lib/uptimed";
|
||||
in {
|
||||
PIDFILE = "${stateDir}/pid";
|
||||
SENDMAIL = lib.mkDefault "${pkgs.system-sendmail}/bin/sendmail -t";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.uptimed = lib.mkIf (cfg.enable) {
|
||||
serviceConfig = let
|
||||
uptimed = pkgs.uptimed.overrideAttrs (prev: {
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile.am \
|
||||
--replace-fail '$(sysconfdir)/uptimed.conf' '/var/lib/uptimed/uptimed.conf'
|
||||
substituteInPlace src/Makefile.am \
|
||||
--replace-fail '$(sysconfdir)/uptimed.conf' '/var/lib/uptimed/uptimed.conf'
|
||||
'';
|
||||
});
|
||||
|
||||
in {
|
||||
Type = "notify";
|
||||
|
||||
ExecStart = lib.mkForce "${uptimed}/sbin/uptimed -f";
|
||||
|
||||
BindReadOnlyPaths = let
|
||||
configFile = lib.pipe cfg.settings [
|
||||
(lib.mapAttrsToList
|
||||
(k: v:
|
||||
if builtins.isList v
|
||||
then lib.mapConcatStringsSep "\n" (v': "${k}=${v'}") v
|
||||
else "${k}=${v}")
|
||||
)
|
||||
(lib.concatStringsSep "\n")
|
||||
(pkgs.writeText "uptimed.conf")
|
||||
];
|
||||
in [
|
||||
"${configFile}:/var/lib/uptimed/uptimed.conf"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
services.uptimed.enable = true;
|
||||
}
|
||||
|
@ -1,5 +1,29 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
services.displayManager = lib.mkIf (!config.machineVars.headless) {
|
||||
enable = true;
|
||||
defaultSession = "none+xmonad";
|
||||
sddm = {
|
||||
enable = true;
|
||||
wayland.enable = config.machineVars.wayland;
|
||||
package = pkgs.kdePackages.sddm;
|
||||
theme = "sddm-astronaut-theme";
|
||||
extraPackages = [
|
||||
pkgs.kdePackages.qt5compat
|
||||
# pkgs.sddm-astronaut
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.sddm-astronaut.override {
|
||||
themeConfig = {
|
||||
PartialBlur = false;
|
||||
# Background = "Backgrounds/";
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
services.xserver = lib.mkIf (!config.machineVars.headless) {
|
||||
enable = true;
|
||||
|
||||
|
@ -109,9 +109,14 @@
|
||||
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
|
||||
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.consoleMode = "1";
|
||||
efi.canTouchEfiVariables = false;
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
fsIdentifier = "label";
|
||||
device = "nodev";
|
||||
efiInstallAsRemovable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -24,11 +24,8 @@
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
boot.loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.consoleMode = "1";
|
||||
};
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"x86_64-windows"
|
||||
@ -56,6 +53,8 @@
|
||||
packages = with pkgs; [ terminus_font ];
|
||||
};
|
||||
|
||||
boot.loader.systemd-boot.consoleMode = "1";
|
||||
|
||||
machineVars = {
|
||||
headless = false;
|
||||
gaming = true;
|
||||
|
@ -1,4 +1,37 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.btrfs.autoScrub.enable = true;
|
||||
|
||||
services.btrbk = {
|
||||
# instances = let
|
||||
# withDefaults = path: conf: lib.recursiveUpdate {
|
||||
# onCalendar = "daily";
|
||||
# settings = {
|
||||
# timestamp_format = "long";
|
||||
# snapshot_preserve_min = "2d";
|
||||
# snapshot_preserve = "14d";
|
||||
# volume.${path} = {
|
||||
# snapshot_create = "always";
|
||||
# subvolume = ".";
|
||||
# snapshot_dir = ".snapshots";
|
||||
# };
|
||||
# };
|
||||
# } conf;
|
||||
# ."var-log"
|
||||
# in {
|
||||
# "var-log" =
|
||||
# settings = {
|
||||
# volume."/home" = {
|
||||
# snapshot_create = "always";
|
||||
# subvolume = ".";
|
||||
# snapshot_dir = ".snapshots";
|
||||
# };
|
||||
# # volume."/var/local" = {
|
||||
# # snapshot_create = "always";
|
||||
# # subvolume = ".";
|
||||
# # snapshot_dir = ".snapshots";
|
||||
# # };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ nix:
|
||||
access-tokens:
|
||||
github: ENC[AES256_GCM,data:reARhNXlxTugP0dRS+PjMUOIYUDzlD7CW7If4F26uM9PEO+6N+KvT0MyuI/eSMaX+bEKWfi+HaZ/SyLw1Pjvretzot9lVqFWG7OrLE4iT+1WCccmwtvbc5Ppl+i2,iv:9pCveUmjl4nKCaLzo+Ybfi6rpzKCxGNRbyRUWUpTNkg=,tag:LT9zUc5C4hqcsVQE+Bfnjw==,type:str]
|
||||
pvv-git: ENC[AES256_GCM,data:fp8utMv7PLrz8LkDvvG7GVY4SiDFOgX8YF1M/hpZyGj9H6pDDvtOTw==,iv:FJmw6Tq81IECxQaJZc9u5gxIWse3OvCF7x7dmJ+m4pg=,tag:hdrsJtFhaj5W5PYTUDRx+g==,type:str]
|
||||
github-nordicsemi: ENC[AES256_GCM,data:tq3XWh2KwLfU3Xwoc3d90cZ34UrM//HyJdbdzJXJstldHE8jIp54Cg==,iv:L4OYYjfWvsQ8LrzE6KAwDmQTXY1gWmtvJrEIa+HEnyE=,tag:jrwtyoA6ORbATXP124OfRg==,type:str]
|
||||
bitbucket-nordicsemi: ENC[AES256_GCM,data:WAJCMJtzuY2Nf2AbutmOu+lz9s337XNiEWjxG3Rdu42asom8hwv0sowA5aI=,iv:0j4DL1ICcl/6vSEh0mKNiYPo0e2PG2tOtWfDktBPZ5U=,tag:jWivhDFFXOic0YGrkMSppg==,type:str]
|
||||
wstunnel:
|
||||
http-upgrade-path-prefix: ENC[AES256_GCM,data:3WG+fu+XXFDgHuEEosWtZKMj51Ks1QIdgWRRsX6RVre8+0t7/4bICoVYtaMSWwMAjH03tt5i1Af1orlKT72gvQ==,iv:syXhMVHwWf9H+HHBhNDq1Y1df9t6VitqhPEqruTnBRA=,tag:1RNmL50z6v4X/cVxkAAvew==,type:str]
|
||||
ssh:
|
||||
@ -87,8 +85,8 @@ sops:
|
||||
WHNjUGdPc1VKNDVoeGVLOUpRcW9JakEKxUfhyC9vhXMkkJwlrV1u9SuxThhmka0E
|
||||
tMbzyqHxFxT4cZScaIDxAl5P8W6mpqmpaN+l/RT+ozeS5FY6+iMVKA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2025-05-06T09:19:20Z"
|
||||
mac: ENC[AES256_GCM,data:u4JVYXJtPUNzByhLlKnVDic47G68r6mtd8RvPeuktrAXsid/DdHLU51yDbGCSizcePxstpQi83m4r/9ZvkYEGkyv4DFG4I+gLr2mqlqEUm9AMjYt4rk0nrZVWzvob8D47MAy2zc3N8ojMgJuEy4xRQKbJvsBdXrQjj0BC7TnuuY=,iv:cMoV4lBOcPgG5iE4ht/Y9ZRpH5TGRDvIbGKCrCrBeGc=,tag:TwJpFt0oAEQ+Oc8+mGnVwg==,type:str]
|
||||
lastmodified: "2025-03-13T14:05:53Z"
|
||||
mac: ENC[AES256_GCM,data:ftoKk3mBVdRn16HGEq5kklw0/RTWpyjneBT2PJUUaGy4u0fWJy8ZfcIcoG+2WekiSFwWBab4kcFHr5KfXX+XEn1Y2brdcirCXr2PdrmccGxyvSiEy/C6OUrB9KiFqpf4tmx3IbYimlxBSE5uQStQATdGWu7cM+hsrW9j5wzWlUU=,iv:jmJHVMZqyf7xTFry76ywN2Yt++2sG/mWsBvaLONGoM4=,tag:19C+PS8tTRVUaqrlQnoDeQ==,type:str]
|
||||
pgp:
|
||||
- created_at: "2025-04-02T10:09:05Z"
|
||||
enc: |-
|
||||
|
Loading…
x
Reference in New Issue
Block a user