Compare commits
27 commits
main
...
aramis-tmp
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c88edc511 | |||
| a371ab9406 | |||
| 452a1e9645 | |||
| 537e16501b | |||
| f02465091c | |||
| ba6d0ee918 | |||
| 8233f8e3d9 | |||
| 5381aa79de | |||
| 4086e94d3c | |||
| 457d4841ea | |||
| c2f07a6529 | |||
| 8e0ea3593c | |||
| 70f651c5fa | |||
| 6a7037f2a6 | |||
| 4d9bab8daf | |||
| ea818e8584 | |||
| 14299fc6e8 | |||
| b0fab6d576 | |||
| c7c593ff93 | |||
| 00da507446 | |||
| 8624f4c6ac | |||
| 3b7a119151 | |||
| b1169858cd | |||
| fe7b0a57a8 | |||
| 7a7da21a27 | |||
| c3603a6191 | |||
| d111734802 |
22 changed files with 171 additions and 142 deletions
30
flake.lock
generated
30
flake.lock
generated
|
|
@ -73,11 +73,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1775087534,
|
||||
"narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
|
||||
"lastModified": 1772408722,
|
||||
"narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
|
||||
"rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -117,11 +117,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1775585728,
|
||||
"narHash": "sha256-8Psjt+TWvE4thRKktJsXfR6PA/fWWsZ04DVaY6PUhr4=",
|
||||
"lastModified": 1775036584,
|
||||
"narHash": "sha256-zW0lyy7ZNNT/x8JhzFHBsP2IPx7ATZIPai4FJj12BgU=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "580633fa3fe5fc0379905986543fd7495481913d",
|
||||
"rev": "4e0eb042b67d863b1b34b3f64d52ceb9cd926735",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -159,11 +159,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1776184304,
|
||||
"narHash": "sha256-No6QGBmIv5ChiwKCcbkxjdEQ/RO2ZS1gD7SFy6EZ7rc=",
|
||||
"lastModified": 1774991950,
|
||||
"narHash": "sha256-kScKj3qJDIWuN9/6PMmgy5esrTUkYinrO5VvILik/zw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "3c7524c68348ef79ce48308e0978611a050089b2",
|
||||
"rev": "f2d3e04e278422c7379e067e323734f3e8c585a7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -175,11 +175,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1776169885,
|
||||
"narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=",
|
||||
"lastModified": 1775020384,
|
||||
"narHash": "sha256-3XiHDhiNxb2vWI0en8ug7WBMEPj9mcaWcMhaFFfhfJY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9",
|
||||
"rev": "c9971bfbabf2fa3f3b7e6e4cbeaa2abd6295b478",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -199,11 +199,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1776248186,
|
||||
"narHash": "sha256-CAWCGtcUvOYwrqeVgvyAKJ6UVQ1x0FQ/l5UWBfKApdE=",
|
||||
"lastModified": 1775037587,
|
||||
"narHash": "sha256-3weRbM7ODQocl6wTgyuKPubhpjS4zP2VA5YxeDx6YG8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "6b1e039f802f6974c56b414f8c8bf95b3d71dc11",
|
||||
"rev": "0a0ed0957d4fee887d5101d3975d40e98658d75c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
# Network-Manager applet
|
||||
nm-applet.enable = true;
|
||||
# Terminal
|
||||
terminal.program = "alacritty";
|
||||
terminal.default = "alacritty";
|
||||
# Transmission remote
|
||||
trgui.enable = true;
|
||||
# Zathura document viewer
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ in
|
|||
{
|
||||
# List services that you want to enable:
|
||||
my.services = {
|
||||
# Hosts-based adblock using unbound
|
||||
adblock = {
|
||||
enable = true;
|
||||
};
|
||||
# Audiobook and podcast library
|
||||
audiobookshelf = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -10,10 +10,8 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.calibre = {
|
||||
enable = true;
|
||||
|
||||
inherit (cfg) package;
|
||||
};
|
||||
home.packages = [
|
||||
cfg.package
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,21 @@
|
|||
let
|
||||
cfg = config.my.home.firefox.tridactyl;
|
||||
|
||||
term = config.my.home.terminal.program;
|
||||
term = config.my.home.terminal.default;
|
||||
|
||||
vimCommandLine = {
|
||||
alacritty = ''-e "vim" "%f" "+normal!%lGzv%c|"'';
|
||||
vimCommandLine =
|
||||
let
|
||||
# Termite wants the whole command in a single argument...
|
||||
termite = ''-e "vim %f '+normal!%lGzv%c|'"'';
|
||||
brokenExecCommand = {
|
||||
termite = true;
|
||||
};
|
||||
# Assume most other terminals are sane and not broken...
|
||||
isBroken = brokenExecCommand.${term} or false;
|
||||
in
|
||||
if isBroken then
|
||||
''-e "vim %f '+normal!%lGzv%c|'"''
|
||||
else
|
||||
''-e "vim" "%f" "+normal!%lGzv%c|"'';
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
|
@ -17,9 +25,9 @@ in
|
|||
# Use my configured terminal
|
||||
term
|
||||
# Make it easy to pick out with a window class name
|
||||
"--class tridactyl_editor"
|
||||
"--title=tridactyl_editor"
|
||||
# Open vim with the cursor in the correct position
|
||||
vimCommandLine.${term}
|
||||
vimCommandLine
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*.out
|
||||
|
||||
# Python files
|
||||
.venv/
|
||||
env/
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
.mypy_cache/
|
||||
|
|
|
|||
|
|
@ -1,9 +1,22 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.terminal;
|
||||
cfg = config.my.home.terminal.alacritty;
|
||||
inherit (config.my.home.terminal) colors;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.program == "alacritty") {
|
||||
options.my.home.terminal = with lib; {
|
||||
default = mkOption {
|
||||
type = with types; nullOr (enum [ "alacritty" ]);
|
||||
};
|
||||
|
||||
alacritty = {
|
||||
enable = mkEnableOption "alacritty" // {
|
||||
default = config.my.home.terminal.default == "alacritty";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -14,36 +27,36 @@ in
|
|||
|
||||
colors = {
|
||||
primary = {
|
||||
background = cfg.colors.background;
|
||||
foreground = cfg.colors.foreground;
|
||||
background = colors.background;
|
||||
foreground = colors.foreground;
|
||||
|
||||
bright_foreground = cfg.colors.foregroundBold;
|
||||
bright_foreground = colors.foregroundBold;
|
||||
};
|
||||
|
||||
cursor = {
|
||||
cursor = cfg.colors.cursor;
|
||||
cursor = colors.cursor;
|
||||
};
|
||||
|
||||
normal = {
|
||||
black = cfg.colors.black;
|
||||
red = cfg.colors.red;
|
||||
green = cfg.colors.green;
|
||||
yellow = cfg.colors.yellow;
|
||||
blue = cfg.colors.blue;
|
||||
magenta = cfg.colors.magenta;
|
||||
cyan = cfg.colors.cyan;
|
||||
white = cfg.colors.white;
|
||||
black = colors.black;
|
||||
red = colors.red;
|
||||
green = colors.green;
|
||||
yellow = colors.yellow;
|
||||
blue = colors.blue;
|
||||
magenta = colors.magenta;
|
||||
cyan = colors.cyan;
|
||||
white = colors.white;
|
||||
};
|
||||
|
||||
bright = {
|
||||
black = cfg.colors.blackBold;
|
||||
red = cfg.colors.redBold;
|
||||
green = cfg.colors.greenBold;
|
||||
yellow = cfg.colors.yellowBold;
|
||||
blue = cfg.colors.blueBold;
|
||||
magenta = cfg.colors.magentaBold;
|
||||
cyan = cfg.colors.cyanBold;
|
||||
white = cfg.colors.whiteBold;
|
||||
black = colors.blackBold;
|
||||
red = colors.redBold;
|
||||
green = colors.greenBold;
|
||||
yellow = colors.yellowBold;
|
||||
blue = colors.blueBold;
|
||||
magenta = colors.magentaBold;
|
||||
cyan = colors.cyanBold;
|
||||
white = colors.whiteBold;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ in
|
|||
|
||||
options.my.home = with lib; {
|
||||
terminal = {
|
||||
program = mkOption {
|
||||
type = with types; nullOr (enum [ "alacritty" "termite" ]);
|
||||
default = mkOption {
|
||||
type = with types; nullOr (enum [ ]);
|
||||
default = null;
|
||||
example = "termite";
|
||||
description = "Which terminal to use for home session";
|
||||
description = "Which default terminal to use for home session";
|
||||
};
|
||||
|
||||
colors = {
|
||||
|
|
@ -56,7 +56,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config.home.sessionVariables = lib.mkIf (cfg.program != null) {
|
||||
TERMINAL = cfg.program;
|
||||
config.home.sessionVariables = lib.mkIf (cfg.default != null) {
|
||||
TERMINAL = cfg.default;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,22 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.terminal;
|
||||
cfg = config.my.home.terminal.termite;
|
||||
inherit (config.my.home.terminal) colors;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.program == "termite") {
|
||||
options.my.home.terminal = with lib; {
|
||||
default = mkOption {
|
||||
type = with types; nullOr (enum [ "termite" ]);
|
||||
};
|
||||
|
||||
termite = {
|
||||
enable = mkEnableOption "termite" // {
|
||||
default = config.my.home.terminal.default == "termite";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.termite = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -24,11 +37,11 @@ in
|
|||
|
||||
|
||||
# Colors
|
||||
backgroundColor = cfg.colors.background;
|
||||
cursorColor = cfg.colors.cursor;
|
||||
foregroundColor = cfg.colors.foreground;
|
||||
foregroundBoldColor = cfg.colors.foregroundBold;
|
||||
colorsExtra = with cfg.colors; ''
|
||||
backgroundColor = colors.background;
|
||||
cursorColor = colors.cursor;
|
||||
foregroundColor = colors.foreground;
|
||||
foregroundBoldColor = colors.foregroundBold;
|
||||
colorsExtra = with colors; ''
|
||||
# Normal colors
|
||||
color0 = ${black}
|
||||
color1 = ${red}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ in
|
|||
};
|
||||
});
|
||||
|
||||
default = { ${config.my.home.terminal.program} = { }; };
|
||||
default = { ${config.my.home.terminal.default} = { }; };
|
||||
defaultText = literalExpression ''
|
||||
{ ''${config.my.home.terminal.program} = { }; };
|
||||
{ ''${config.my.home.terminal.default} = { }; };
|
||||
'';
|
||||
example = { xterm-256color = { }; };
|
||||
description = ''
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ local keys = {
|
|||
|
||||
-- Disable option
|
||||
{ "]o", group = "Disable option" },
|
||||
{ "]ob", desc = "Dark background" },
|
||||
{ "]ob", desc = "Light background" },
|
||||
{ "]oc", desc = "Cursor line" },
|
||||
{ "]od", desc = "Diff" },
|
||||
{ "]of", "<cmd>FormatDisable<CR>", desc = "LSP Formatting" },
|
||||
|
|
@ -101,7 +101,7 @@ local keys = {
|
|||
|
||||
-- Toggle option
|
||||
{ "yo", group = "Toggle option" },
|
||||
{ "yob", desc = "Toggle background" },
|
||||
{ "yob", desc = "Light background" },
|
||||
{ "yoc", desc = "Cursor line" },
|
||||
{ "yod", desc = "Diff" },
|
||||
{ "yof", "<cmd>FormatToggle<CR>", desc = "LSP Formatting" },
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ colorscheme gruvbox
|
|||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Enable search high-lighting while the search is on-going
|
||||
set hlsearch
|
||||
" Ignore case on search unless \C is in search terms
|
||||
" Ignore case on search
|
||||
set ignorecase
|
||||
" Ignore case unless there is an uppercase letter in the pattern
|
||||
set smartcase
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
-- Show lines numbers
|
||||
vim.opt.number = true
|
||||
|
||||
local numbertoggle = vim.api.nvim_create_augroup("ambroisie.numbertoggle", { clear = true })
|
||||
local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", { clear = true })
|
||||
|
||||
-- Toggle numbers between relative and absolute when changing buffers
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, {
|
||||
|
|
|
|||
|
|
@ -76,14 +76,14 @@ local function treesitter_try_attach(buf, language)
|
|||
-- Syntax highlighting
|
||||
vim.treesitter.start(buf, language)
|
||||
-- Indentation
|
||||
vim.bo.indentexpr = "v:lua.require('nvim-treesitter').indentexpr()"
|
||||
vim.bo[buf].indentexpr = "v:lua.require('nvim-treesitter').indentexpr()"
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "*",
|
||||
group = vim.api.nvim_create_augroup("ambroisie.treesitter_attach", { clear = true }),
|
||||
group = vim.api.nvim_create_augroup("treesitter_attach", { clear = true }),
|
||||
callback = function(args)
|
||||
local buf, filetype = args.buf, args.match
|
||||
local language = vim.treesitter.language.get_lang(filetype)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local signtoggle = vim.api.nvim_create_augroup("ambroisie.signtoggle", { clear = true })
|
||||
local signtoggle = vim.api.nvim_create_augroup("signtoggle", { clear = true })
|
||||
|
||||
-- Only show sign column for the currently focused buffer, if it has a number column
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "WinEnter" }, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
mkRelatedOption = description: relatedWMs:
|
||||
let
|
||||
|
|
@ -20,14 +20,14 @@ in
|
|||
|
||||
options.my.home.wm = with lib; {
|
||||
windowManager = mkOption {
|
||||
type = with types; nullOr (enum [ "i3" ]);
|
||||
type = with types; nullOr (enum [ ]);
|
||||
default = null;
|
||||
example = "i3";
|
||||
description = "Which window manager to use for home session";
|
||||
};
|
||||
|
||||
cursor = {
|
||||
enable = mkRelatedOption "dunst configuration" [ "i3" ];
|
||||
enable = mkRelatedOption "cursor configuration" [ "i3" ];
|
||||
};
|
||||
|
||||
dunst = {
|
||||
|
|
@ -68,29 +68,14 @@ in
|
|||
};
|
||||
|
||||
screen-lock = {
|
||||
enable = mkRelatedOption "automatic X screen locker" [ "i3" ];
|
||||
enable = mkRelatedOption "automatic screen locker" [ "i3" ];
|
||||
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
default = "${lib.getExe pkgs.i3lock} -n -c 000000";
|
||||
example = "\${lib.getExe pkgs.i3lock} -n -i lock.png";
|
||||
description = "Locker command to run";
|
||||
};
|
||||
|
||||
cornerLock = {
|
||||
enable = my.mkDisableOption ''
|
||||
Move mouse to upper-left corner to lock instantly, lower-right corner to
|
||||
disable auto-lock.
|
||||
'';
|
||||
|
||||
delay = mkOption {
|
||||
type = types.int;
|
||||
default = 5;
|
||||
example = 15;
|
||||
description = "How many seconds before locking this way";
|
||||
};
|
||||
};
|
||||
|
||||
notify = {
|
||||
enable = my.mkDisableOption "Notify when about to lock the screen";
|
||||
|
||||
|
|
@ -100,17 +85,15 @@ in
|
|||
example = 15;
|
||||
description = ''
|
||||
How many seconds in advance should there be a notification.
|
||||
This value must be at lesser than or equal to `cornerLock.delay`
|
||||
when both options are enabled.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
timeout = mkOption {
|
||||
type = types.ints.between 1 60;
|
||||
type = types.int;
|
||||
default = 15;
|
||||
example = 1;
|
||||
description = "Inactive time interval to lock the screen automatically";
|
||||
description = "Inactive time interval (in minutes) to lock the screen automatically";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ let
|
|||
isEnabled = config.my.home.wm.windowManager == "i3";
|
||||
|
||||
terminal =
|
||||
if config.my.home.terminal.program != null
|
||||
then config.my.home.terminal.program
|
||||
if config.my.home.terminal.default != null
|
||||
then config.my.home.terminal.default
|
||||
else "i3-sensible-terminal";
|
||||
|
||||
alt = "Mod1"; # `Alt` key
|
||||
|
|
@ -47,15 +47,25 @@ let
|
|||
if ${systemctlUser} is-active xautolock-session.service; then
|
||||
${systemctlUser} stop --user xautolock-session.service
|
||||
xset s off
|
||||
xset s 0 0
|
||||
xset -dpms
|
||||
${notify} "Disabled Xautolock"
|
||||
else
|
||||
${systemctlUser} start xautolock-session.service
|
||||
xset s on
|
||||
xset s 0 0
|
||||
xset +dpms
|
||||
${notify} "Enabled Xautolock"
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.my.home.wm = with lib; {
|
||||
windowManager = mkOption {
|
||||
type = with types; nullOr (enum [ "i3" ]);
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf isEnabled {
|
||||
home.packages = with pkgs; [
|
||||
ambroisie.dragger # drag-and-drop from the CLI
|
||||
|
|
@ -65,6 +75,9 @@ in
|
|||
xdotool # Used by 'rofi-rbw', in a mapping
|
||||
];
|
||||
|
||||
# Set `i3lock` as the (default) lock command
|
||||
my.home.wm.screen-lock.command = lib.mkDefault "${lib.getExe pkgs.i3lock} -n -c 000000";
|
||||
|
||||
xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -123,7 +136,7 @@ in
|
|||
inherit modifier;
|
||||
|
||||
criteria = [
|
||||
{ class = "^tridactyl_editor$"; }
|
||||
{ title = "^tridactyl_editor$"; }
|
||||
{ class = "^Blueman-.*$"; }
|
||||
{ title = "^htop$"; }
|
||||
{ class = "^Thunderbird$"; instance = "Mailnews"; window_role = "filterlist"; }
|
||||
|
|
@ -387,5 +400,10 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Use a grey background
|
||||
xsession.profileExtra = ''
|
||||
${lib.getExe pkgs.xsetroot} -solid '#333333'
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ in
|
|||
programs.rofi = {
|
||||
enable = true;
|
||||
|
||||
terminal = config.my.home.terminal.program; # null by default
|
||||
terminal = config.my.home.terminal.default; # null by default
|
||||
|
||||
package = pkgs.rofi.override {
|
||||
plugins = with pkgs; [
|
||||
|
|
|
|||
|
|
@ -2,32 +2,22 @@
|
|||
let
|
||||
cfg = config.my.home.wm.screen-lock;
|
||||
|
||||
notificationCmd =
|
||||
let
|
||||
duration = toString (cfg.notify.delay * 1000);
|
||||
notifyCmd = "${lib.getExe pkgs.libnotify} -u critical -t ${duration}";
|
||||
in
|
||||
# Needs to be surrounded by quotes for systemd to launch it correctly
|
||||
''"${notifyCmd} -- 'Locking in ${toString cfg.notify.delay} seconds'"'';
|
||||
lockNotifier = pkgs.writeShellApplication {
|
||||
name = "lock-notifier";
|
||||
runtimeInputs = [
|
||||
pkgs.libnotify
|
||||
];
|
||||
text = ''
|
||||
duration=${toString cfg.notify.delay}
|
||||
notify-send \
|
||||
-u critical \
|
||||
-t "$((duration * 1000))" -- \
|
||||
"Locking in $duration seconds"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion =
|
||||
let
|
||||
inherit (cfg) cornerLock notify;
|
||||
bothEnabled = cornerLock.enable && notify.enable;
|
||||
cornerLockHigherThanNotify = cornerLock.delay >= notify.delay;
|
||||
in
|
||||
bothEnabled -> cornerLockHigherThanNotify;
|
||||
message = ''
|
||||
`config.my.home.wm.notify.delay` cannot have a value higher than
|
||||
`config.my.home.wm.cornerLock.delay`.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
services.screen-locker = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -36,19 +26,11 @@ in
|
|||
lockCmd = cfg.command;
|
||||
|
||||
xautolock = {
|
||||
extraOptions = lib.optionals cfg.cornerLock.enable [
|
||||
# Mouse corners: instant lock on upper-left, never lock on lower-right
|
||||
"-cornerdelay"
|
||||
"${toString cfg.cornerLock.delay}"
|
||||
"-cornerredelay"
|
||||
"${toString cfg.cornerLock.delay}"
|
||||
"-corners"
|
||||
"+00-"
|
||||
] ++ lib.optionals cfg.notify.enable [
|
||||
extraOptions = lib.optionals cfg.notify.enable [
|
||||
"-notify"
|
||||
"${toString cfg.notify.delay}"
|
||||
"-notifier"
|
||||
notificationCmd
|
||||
(lib.getExe lockNotifier)
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.profiles.x;
|
||||
in
|
||||
|
|
@ -10,12 +10,6 @@ in
|
|||
config = lib.mkIf cfg.enable {
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
# Nice wallpaper
|
||||
services.xserver.displayManager.lightdm.background =
|
||||
let
|
||||
wallpapers = "${pkgs.kdePackages.plasma-workspace-wallpapers}/share/wallpapers";
|
||||
in
|
||||
"${wallpapers}/summer_1am/contents/images/2560x1600.jpg";
|
||||
|
||||
# X configuration
|
||||
my.home.x.enable = true;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
let
|
||||
cfg = config.my.services.matrix;
|
||||
|
||||
adminPkg = pkgs.ketesa;
|
||||
adminPkg = pkgs.synapse-admin-etkecc;
|
||||
|
||||
domain = config.networking.domain;
|
||||
matrixDomain = "matrix.${domain}";
|
||||
|
|
|
|||
|
|
@ -81,7 +81,19 @@ let
|
|||
lib.mapAttrsToList mkPeer otherPeers;
|
||||
|
||||
# Set up clients to use configured DNS servers
|
||||
dns = cfg.dns.additionalServers;
|
||||
dns =
|
||||
let
|
||||
toInternalIps = peer: [
|
||||
"${cfg.net.v4.subnet}.${toString peer.clientNum}"
|
||||
"${cfg.net.v6.subnet}::${toString peer.clientNum}"
|
||||
];
|
||||
# We know that `otherPeers` is an attribute set of servers
|
||||
internalIps = lib.flatten
|
||||
(lib.mapAttrsToList (_: peer: toInternalIps peer) otherPeers);
|
||||
internalServers = lib.optionals cfg.dns.useInternal internalIps;
|
||||
in
|
||||
lib.mkIf (!thisPeerIsServer)
|
||||
(internalServers ++ cfg.dns.additionalServers);
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
@ -110,6 +122,10 @@ in
|
|||
};
|
||||
|
||||
dns = {
|
||||
useInternal = my.mkDisableOption ''
|
||||
Use internal DNS servers from wireguard 'server'
|
||||
'';
|
||||
|
||||
additionalServers = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue