2023-07-30 16:18:49 +00:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
|
|
|
|
{ config, lib, nixpkgs, pkgs, home-manager, ... }:
|
|
|
|
|
|
2024-03-14 10:13:21 +00:00
|
|
|
|
let
|
|
|
|
|
my_python = (pkgs.python3.withPackages (ps: with ps; [ git_plan ]));
|
|
|
|
|
|
|
|
|
|
my_emacs = (pkgs.emacsWithPackagesFromUsePackage {
|
|
|
|
|
config = ./emacs.el;
|
|
|
|
|
defaultInitFile = true;
|
|
|
|
|
package = pkgs.emacs29-pgtk.overrideAttrs (old: { withTreeSitter = true; });
|
2024-05-15 19:46:11 +00:00
|
|
|
|
#alwaysEnsure = true;
|
2024-03-14 10:13:21 +00:00
|
|
|
|
extraEmacsPackages = epkgs: [
|
|
|
|
|
pkgs.mu
|
2024-05-15 19:46:11 +00:00
|
|
|
|
pkgs.mu.mu4e
|
2024-03-14 10:13:21 +00:00
|
|
|
|
epkgs.treesit-grammars.with-all-grammars
|
2024-05-15 19:46:11 +00:00
|
|
|
|
epkgs.evil-collection
|
2024-03-14 10:13:21 +00:00
|
|
|
|
];
|
|
|
|
|
});
|
2023-10-25 23:31:53 +00:00
|
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
|
in {
|
|
|
|
|
imports = [
|
|
|
|
|
#./gnupg.nix
|
|
|
|
|
];
|
2023-07-30 16:18:49 +00:00
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
|
nix.extraOptions = ''
|
|
|
|
|
!include ${config.sops.secrets.github_token.path}
|
|
|
|
|
bash-prompt = (nix:$name)\040\[\033[1;32m\][\u@\h:\w]\$\[\033[0m\]\040
|
2023-10-25 23:31:53 +00:00
|
|
|
|
extra-sandbox-paths = /nix/var/cache/ccache
|
2023-07-30 16:18:49 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
sops = {
|
|
|
|
|
environment.SOPS_GPG_EXEC = "${pkgs.gnupg}/bin/gpg";
|
|
|
|
|
defaultSopsFile = ./secrets.yaml;
|
|
|
|
|
secrets = {
|
|
|
|
|
fastmail_password = {
|
|
|
|
|
owner = config.users.users.knazarov.name;
|
|
|
|
|
group = config.users.users.knazarov.group;
|
|
|
|
|
};
|
|
|
|
|
github_token = {
|
|
|
|
|
owner = config.users.users.knazarov.name;
|
|
|
|
|
group = config.users.users.knazarov.group;
|
|
|
|
|
};
|
2023-08-15 14:25:03 +00:00
|
|
|
|
git_plan_config = {
|
|
|
|
|
owner = config.users.users.knazarov.name;
|
|
|
|
|
group = config.users.users.knazarov.group;
|
|
|
|
|
};
|
|
|
|
|
git_plan_credentials = {
|
|
|
|
|
owner = config.users.users.knazarov.name;
|
|
|
|
|
group = config.users.users.knazarov.group;
|
|
|
|
|
};
|
2024-10-28 20:45:28 +00:00
|
|
|
|
syncthing_key = {
|
|
|
|
|
owner = config.users.users.knazarov.name;
|
|
|
|
|
group = config.users.users.knazarov.group;
|
|
|
|
|
};
|
|
|
|
|
syncthing_cert = {
|
|
|
|
|
owner = config.users.users.knazarov.name;
|
|
|
|
|
group = config.users.users.knazarov.group;
|
|
|
|
|
};
|
2023-09-30 22:07:32 +00:00
|
|
|
|
mullvad_account = { };
|
2024-10-30 21:49:16 +00:00
|
|
|
|
kagi_api_key = {
|
|
|
|
|
owner = config.users.users.knazarov.name;
|
|
|
|
|
group = config.users.users.knazarov.group;
|
|
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
|
|
|
|
|
|
|
|
# Configure network proxy if necessary
|
|
|
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
|
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
|
|
|
|
|
|
|
|
# Enable networking
|
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "Europe/London";
|
|
|
|
|
|
|
|
|
|
# Select internationalisation properties.
|
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
|
|
|
|
|
|
i18n.extraLocaleSettings = {
|
|
|
|
|
LC_ADDRESS = "en_US.UTF-8";
|
|
|
|
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
|
|
|
|
LC_MEASUREMENT = "en_US.UTF-8";
|
|
|
|
|
LC_MONETARY = "en_US.UTF-8";
|
|
|
|
|
LC_NAME = "en_US.UTF-8";
|
|
|
|
|
LC_NUMERIC = "en_US.UTF-8";
|
|
|
|
|
LC_PAPER = "en_US.UTF-8";
|
|
|
|
|
LC_TELEPHONE = "en_US.UTF-8";
|
|
|
|
|
LC_TIME = "en_US.UTF-8";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Mainly to access SMB shares on local network
|
|
|
|
|
services.gvfs = {
|
|
|
|
|
enable = true;
|
2024-11-02 22:05:34 +00:00
|
|
|
|
package = lib.mkForce pkgs.gnome.gvfs;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Configure keymap in X11
|
|
|
|
|
services.xserver = {
|
2024-06-24 20:28:45 +00:00
|
|
|
|
xkb.layout = "us";
|
|
|
|
|
xkb.variant = "";
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
|
|
|
users.users.knazarov = {
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
description = "Konstantin Nazarov";
|
2024-03-14 10:13:21 +00:00
|
|
|
|
extraGroups = [ "networkmanager" "wheel" config.users.groups.keys.name ];
|
2023-09-30 22:07:32 +00:00
|
|
|
|
packages = with pkgs; [ ];
|
2023-07-30 16:18:49 +00:00
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGxebDydOcs7URJjXFHMU++ruaZOJpXbK4ixH19pWTsX7WtxxriZxD4+RQ3oyllGG/8sEFzEe0NoTHUPU6YrBpfwT/ekGDmCJHtvZ+rZs+cRQd6tObfAUip1B1Mcvhuaj0prnrbfohOuHpvQ/L8TogIKuHgczDmud4KGUu0mxCsUHbD5tlKpsgN+dJXkvjxsO7JhhF9JpFTrYAU0gTuBPTt3ynpnZKrE1NgnE0iy+CEr/v41dLqxw3fUjT3nOFUQ1l/VKTw5mLt5Iw7XmBLuFGLRAVrwzXxeBCfYqKGYgY4QV8HCcVpcqC8zWmRskiRetzQ/5HwRagm4yZr0I+LZ305nGB0cSJzLWXXOUF6SDg2cqAXFpF/o2LoFCmaV5h3jmCGOUrowF7oV4mYwBMWfabrbZx21z/R56GkAOOEKc2h+Qh5wIj4yayX081SkqJK3J9+3vGG4VvXnwGnPnWQFqrzeedyV74maffGBGFYm0UOcD+oG6EwM+7MEUBpJm9m4c= knazarov"
|
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHkDvP2BO1uV0AwEjABYFEiA2BbGo1IsSht4emYMRLgi root@mira"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
# needed to request polkit access (for instance, for SMB shares)
|
|
|
|
|
lxqt.lxqt-policykit
|
|
|
|
|
vim
|
|
|
|
|
waybar
|
|
|
|
|
foot
|
|
|
|
|
wayland
|
|
|
|
|
xdg-utils
|
|
|
|
|
glib
|
2024-11-23 09:51:10 +00:00
|
|
|
|
bc
|
2023-07-30 16:18:49 +00:00
|
|
|
|
dracula-theme
|
2024-09-08 23:38:16 +00:00
|
|
|
|
adwaita-icon-theme
|
2023-07-30 16:18:49 +00:00
|
|
|
|
swaylock
|
|
|
|
|
swayidle
|
|
|
|
|
wl-clipboard
|
|
|
|
|
keyd
|
|
|
|
|
tdesktop
|
|
|
|
|
git
|
|
|
|
|
source-code-pro
|
|
|
|
|
pavucontrol
|
|
|
|
|
brightnessctl
|
|
|
|
|
sops
|
|
|
|
|
age
|
|
|
|
|
ssh-to-age
|
|
|
|
|
syncthing
|
|
|
|
|
pass
|
|
|
|
|
pkgs.gnupg
|
|
|
|
|
pciutils
|
|
|
|
|
slack
|
|
|
|
|
q-sh
|
2023-09-30 22:07:32 +00:00
|
|
|
|
notes-sh
|
2024-09-08 23:38:16 +00:00
|
|
|
|
transmission_4-gtk
|
2023-07-30 16:18:49 +00:00
|
|
|
|
mpv
|
|
|
|
|
imv
|
|
|
|
|
okular
|
|
|
|
|
yt-dlp
|
|
|
|
|
evince # document viewer
|
|
|
|
|
firefox
|
|
|
|
|
gthumb
|
|
|
|
|
unzip
|
|
|
|
|
somafm-cli
|
2024-11-02 22:05:34 +00:00
|
|
|
|
# these packages have some problem with installation now
|
|
|
|
|
#yubikey-manager
|
|
|
|
|
#yubikey-manager-qt
|
2023-07-30 16:18:49 +00:00
|
|
|
|
ripgrep
|
|
|
|
|
file
|
|
|
|
|
zoom-us
|
|
|
|
|
obs-studio
|
2024-09-08 23:38:16 +00:00
|
|
|
|
nautilus
|
2023-07-30 16:18:49 +00:00
|
|
|
|
xfce.thunar
|
|
|
|
|
zig
|
|
|
|
|
mullvad-vpn
|
|
|
|
|
mullvad
|
2023-08-14 21:50:06 +00:00
|
|
|
|
usbutils
|
2023-09-09 21:17:02 +00:00
|
|
|
|
xournalpp
|
|
|
|
|
dnsutils
|
2023-09-26 20:19:24 +00:00
|
|
|
|
graphviz
|
2023-09-30 22:07:32 +00:00
|
|
|
|
fzf
|
2024-05-11 16:20:32 +00:00
|
|
|
|
fd
|
2023-09-30 22:07:32 +00:00
|
|
|
|
nixfmt
|
2023-10-25 23:31:53 +00:00
|
|
|
|
my_emacs
|
|
|
|
|
libreoffice
|
2024-03-14 10:13:21 +00:00
|
|
|
|
gcc
|
2024-05-11 16:20:32 +00:00
|
|
|
|
neovim
|
|
|
|
|
go
|
|
|
|
|
gopls
|
2024-05-15 19:46:11 +00:00
|
|
|
|
lazygit
|
2024-07-08 19:36:39 +00:00
|
|
|
|
guile
|
|
|
|
|
solc
|
|
|
|
|
kdenlive
|
2024-09-08 23:38:16 +00:00
|
|
|
|
kooha # screen capture
|
2024-11-02 22:05:34 +00:00
|
|
|
|
inotify-tools
|
2024-09-08 23:38:16 +00:00
|
|
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
# mainly needed for npm which decided to play hardball
|
|
|
|
|
automake
|
|
|
|
|
autoconf
|
|
|
|
|
# ----------
|
|
|
|
|
|
2024-07-08 19:36:39 +00:00
|
|
|
|
(pkgs.callPackage ./nil_cli.nix {})
|
2023-09-09 21:17:02 +00:00
|
|
|
|
#network-manager-applet
|
2024-09-08 23:38:16 +00:00
|
|
|
|
#(clang-tools.override {
|
|
|
|
|
#llvmPackages = llvmPackages_17;
|
|
|
|
|
#enableLibcxx = false;
|
|
|
|
|
#}) # mainly for clang-format
|
|
|
|
|
clang-tools
|
2023-07-30 16:18:49 +00:00
|
|
|
|
# wget
|
2023-08-15 14:25:03 +00:00
|
|
|
|
my_python
|
2024-10-28 20:45:28 +00:00
|
|
|
|
|
|
|
|
|
# latex basics
|
|
|
|
|
(pkgs.texlive.combine {
|
|
|
|
|
inherit (pkgs.texlive) scheme-basic
|
|
|
|
|
dvisvgm dvipng beamer metafont
|
|
|
|
|
wrapfig amsmath ulem hyperref capt-of;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
nodejs
|
2024-10-30 21:49:16 +00:00
|
|
|
|
|
|
|
|
|
networkmanagerapplet
|
2024-11-02 22:05:34 +00:00
|
|
|
|
|
|
|
|
|
qpwgraph
|
2024-11-23 09:51:10 +00:00
|
|
|
|
|
|
|
|
|
bat
|
|
|
|
|
chafa
|
2023-07-30 16:18:49 +00:00
|
|
|
|
];
|
|
|
|
|
|
2024-10-30 21:49:16 +00:00
|
|
|
|
services.blueman.enable = true;
|
|
|
|
|
|
2024-10-28 20:45:28 +00:00
|
|
|
|
services.tailscale.enable = true;
|
|
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
|
services.mullvad-vpn = { enable = true; };
|
|
|
|
|
systemd.services."mullvad-daemon".postStart =
|
|
|
|
|
let mullvad = config.services.mullvad-vpn.package;
|
|
|
|
|
in ''
|
|
|
|
|
while ! ${mullvad}/bin/mullvad status >/dev/null; do sleep 1; done
|
|
|
|
|
${mullvad}/bin/mullvad account login `cat /var/run/secrets/mullvad_account`
|
|
|
|
|
${mullvad}/bin/mullvad auto-connect set on
|
2024-10-28 20:45:28 +00:00
|
|
|
|
${mullvad}/bin/mullvad tunnel set ipv6 on
|
2023-09-30 22:07:32 +00:00
|
|
|
|
'';
|
2023-09-09 21:17:02 +00:00
|
|
|
|
|
|
|
|
|
services.fwupd.enable = true;
|
|
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
|
services.gnome.gnome-keyring.enable = true;
|
2023-10-25 23:31:53 +00:00
|
|
|
|
#services.emacs.package = nixpkgs.emacsUnstablePgtk;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
|
|
|
|
|
# Enables wayland support in electron apps (e.g. slack)
|
|
|
|
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
|
|
|
|
|
|
|
|
|
# Enable screen sharing on Wayland
|
|
|
|
|
xdg = {
|
|
|
|
|
portal = {
|
|
|
|
|
enable = true;
|
2023-08-19 18:18:44 +00:00
|
|
|
|
wlr.enable = true;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
extraPortals = with pkgs; [
|
|
|
|
|
xdg-desktop-portal-wlr
|
|
|
|
|
xdg-desktop-portal-gtk
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Some programs need SUID wrappers, can be configured further or are
|
|
|
|
|
# started in user sessions.
|
|
|
|
|
# programs.mtr.enable = true;
|
|
|
|
|
programs.gnupg.package = pkgs.gnupg;
|
|
|
|
|
programs.gnupg.agent = {
|
2023-09-30 22:07:32 +00:00
|
|
|
|
enable = true;
|
|
|
|
|
enableSSHSupport = true;
|
2024-09-20 02:22:42 +00:00
|
|
|
|
enableExtraSocket = true;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
programs.sway = {
|
|
|
|
|
enable = true;
|
|
|
|
|
wrapperFeatures.gtk = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# List services that you want to enable:
|
|
|
|
|
|
|
|
|
|
services.pipewire = {
|
|
|
|
|
enable = true;
|
|
|
|
|
alsa.enable = true;
|
|
|
|
|
alsa.support32Bit = true;
|
|
|
|
|
pulse.enable = true;
|
2023-08-19 18:18:44 +00:00
|
|
|
|
wireplumber.enable = true;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
2023-08-17 17:33:56 +00:00
|
|
|
|
|
2024-10-30 21:49:16 +00:00
|
|
|
|
services.pipewire.wireplumber.extraConfig.bluetoothEnhancements = {
|
|
|
|
|
"monitor.bluez.properties" = {
|
|
|
|
|
"bluez5.enable-sbc-xq" = true;
|
|
|
|
|
"bluez5.enable-msbc" = true;
|
|
|
|
|
"bluez5.enable-hw-volume" = true;
|
|
|
|
|
"bluez5.roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-20 02:22:42 +00:00
|
|
|
|
programs.steam = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-17 17:33:56 +00:00
|
|
|
|
# Disable unneeded PipeWire devices and rename the ones I use to more recognizable names
|
|
|
|
|
environment.etc."wireplumber/main.lua.d/51-device-rename.lua".text = ''
|
|
|
|
|
table.insert(alsa_monitor.rules, {
|
|
|
|
|
matches = {
|
|
|
|
|
{
|
|
|
|
|
{ "node.name", "equals", "alsa_output.usb-Audioengine_LLC_Audioengine_2__AE202010001A2002-00.analog-stereo" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
apply_properties = {
|
|
|
|
|
["node.description"] = "Speakers",
|
|
|
|
|
["node.nick"] = "Speakers",
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
table.insert(alsa_monitor.rules, {
|
|
|
|
|
matches = {
|
|
|
|
|
{
|
|
|
|
|
{ "node.name", "equals", "alsa_output.usb-SteelSeries_SteelSeries_Arctis_5_00000000-00.analog-chat" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
apply_properties = {
|
|
|
|
|
["node.description"] = "Headphones",
|
|
|
|
|
["node.nick"] = "Headphones",
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
table.insert(alsa_monitor.rules, {
|
|
|
|
|
matches = {
|
|
|
|
|
{
|
|
|
|
|
{ "node.name", "equals", "alsa_input.usb-SteelSeries_SteelSeries_Arctis_5_00000000-00.analog-chat" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
apply_properties = {
|
|
|
|
|
["node.description"] = "Headphone Mic",
|
|
|
|
|
["node.nick"] = "Headphone Mic",
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
table.insert(alsa_monitor.rules, {
|
|
|
|
|
matches = {
|
|
|
|
|
{{ "node.name", "equals", "alsa_output.usb-SteelSeries_SteelSeries_Arctis_5_00000000-00.analog-game" },},
|
|
|
|
|
},
|
|
|
|
|
apply_properties = {
|
|
|
|
|
["node.disabled"] = true,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
table.insert(alsa_monitor.rules, {
|
|
|
|
|
matches = {
|
|
|
|
|
{{ "node.name", "equals", "alsa_output.pci-0000_14_00.1.hdmi-stereo" },},
|
|
|
|
|
},
|
|
|
|
|
apply_properties = {
|
|
|
|
|
["node.disabled"] = true,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
table.insert(alsa_monitor.rules, {
|
|
|
|
|
matches = {
|
|
|
|
|
{{ "node.name", "equals", "alsa_input.usb-MACROSILICON_USB_Video-02.analog-stereo" },},
|
|
|
|
|
},
|
|
|
|
|
apply_properties = {
|
|
|
|
|
["node.disabled"] = true,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
'';
|
|
|
|
|
|
2023-07-30 16:18:49 +00:00
|
|
|
|
services.dbus.enable = true;
|
|
|
|
|
|
|
|
|
|
services.greetd = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings = rec {
|
|
|
|
|
initial_session = {
|
|
|
|
|
command = "${pkgs.sway}/bin/sway";
|
|
|
|
|
user = "knazarov";
|
|
|
|
|
};
|
|
|
|
|
default_session = initial_session;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.keyd = {
|
|
|
|
|
enable = true;
|
2024-03-14 10:13:21 +00:00
|
|
|
|
keyboards = {
|
2024-05-26 20:21:45 +00:00
|
|
|
|
|
2024-06-27 20:46:31 +00:00
|
|
|
|
default = {
|
|
|
|
|
ids = [ "*" ];
|
|
|
|
|
settings = {
|
|
|
|
|
main = {
|
|
|
|
|
capslock = "overload(control, esc)";
|
|
|
|
|
leftalt = "layer(meta_mac)";
|
|
|
|
|
leftmeta = "layer(alt)";
|
|
|
|
|
};
|
|
|
|
|
"meta_mac:M" = {
|
|
|
|
|
c = "C-insert";
|
|
|
|
|
v = "S-insert";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh = {
|
|
|
|
|
enable = true;
|
2023-09-30 22:07:32 +00:00
|
|
|
|
# settings = {
|
|
|
|
|
# passwordAuthentication = false;
|
|
|
|
|
# kbdInteractiveAuthentication = false;
|
|
|
|
|
# };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-10-25 23:31:53 +00:00
|
|
|
|
services.jellyfin = {
|
|
|
|
|
enable = true;
|
|
|
|
|
openFirewall = true;
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-30 16:18:49 +00:00
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
2024-03-14 10:13:21 +00:00
|
|
|
|
8096
|
2023-07-30 16:18:49 +00:00
|
|
|
|
# Syncthing
|
2023-09-30 22:07:32 +00:00
|
|
|
|
8384
|
|
|
|
|
22000
|
2023-07-30 16:18:49 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
networking.firewall.allowedUDPPorts = [
|
|
|
|
|
# Syncthing
|
2023-09-30 22:07:32 +00:00
|
|
|
|
22000
|
|
|
|
|
21027
|
2023-07-30 16:18:49 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
2024-03-14 10:13:21 +00:00
|
|
|
|
system.stateVersion = "23.11"; # Did you read the comment?
|
2023-07-30 16:18:49 +00:00
|
|
|
|
|
|
|
|
|
# needed for sway
|
|
|
|
|
security.polkit.enable = true;
|
|
|
|
|
# needed for pipewire
|
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
|
|
|
|
|
# allow remote rebuilds
|
|
|
|
|
nix.settings.trusted-users = [ "@wheel" ];
|
|
|
|
|
|
|
|
|
|
# needed for YubiKey smartcard support
|
|
|
|
|
services.pcscd.enable = true;
|
|
|
|
|
|
|
|
|
|
fonts.fontDir.enable = true;
|
2024-04-10 12:10:23 +00:00
|
|
|
|
fonts.packages = with pkgs; [
|
2023-07-30 16:18:49 +00:00
|
|
|
|
dejavu_fonts
|
2024-05-11 16:20:32 +00:00
|
|
|
|
(nerdfonts.override { fonts = [ "SourceCodePro" ]; })
|
2023-07-30 16:18:49 +00:00
|
|
|
|
source-code-pro
|
|
|
|
|
font-awesome # for waybar indicators
|
|
|
|
|
];
|
|
|
|
|
|
2024-10-28 20:45:28 +00:00
|
|
|
|
services.syncthing = {
|
|
|
|
|
enable = true;
|
|
|
|
|
user = "knazarov";
|
|
|
|
|
configDir = "/home/knazarov/.config/syncthing";
|
|
|
|
|
key = config.sops.secrets.syncthing_key.path;
|
|
|
|
|
cert = config.sops.secrets.syncthing_cert.path;
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-30 16:18:49 +00:00
|
|
|
|
home-manager.users.knazarov = {
|
2023-09-30 22:07:32 +00:00
|
|
|
|
# The home.stateVersion option does not have a default and must be set
|
2024-09-08 23:38:16 +00:00
|
|
|
|
home.stateVersion = "24.11";
|
2024-05-15 19:46:11 +00:00
|
|
|
|
|
2024-07-08 19:36:39 +00:00
|
|
|
|
home.sessionVariables = {
|
|
|
|
|
EDITOR = "emacs -nw --no-splash";
|
|
|
|
|
GUILE_LOAD_PATH = "${config.users.users.knazarov.home}/guile";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
home.file.".guile" = {
|
|
|
|
|
source = ./guile-config;
|
|
|
|
|
};
|
2024-05-15 19:46:11 +00:00
|
|
|
|
|
|
|
|
|
programs.lf = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
set sixel true
|
|
|
|
|
set previewer ${pkgs.chafa}/bin/chafa
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
|
2024-11-23 09:51:10 +00:00
|
|
|
|
programs.bat = {
|
|
|
|
|
enable = true;
|
|
|
|
|
config = {
|
|
|
|
|
theme = "ansi";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-30 16:18:49 +00:00
|
|
|
|
programs.bash = {
|
|
|
|
|
enable = true;
|
|
|
|
|
bashrcExtra = ''
|
2023-09-30 22:07:32 +00:00
|
|
|
|
if [[ "$INSIDE_EMACS" = 'vterm' ]] \
|
|
|
|
|
&& [[ -n ''${EMACS_VTERM_PATH} ]] \
|
|
|
|
|
&& [[ -f ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh ]]; then
|
|
|
|
|
source ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh
|
|
|
|
|
fi
|
2023-07-30 16:18:49 +00:00
|
|
|
|
'';
|
2023-10-25 23:31:53 +00:00
|
|
|
|
shellAliases = {
|
|
|
|
|
nn = "notes.sh -n";
|
|
|
|
|
ne =
|
2024-11-23 09:51:10 +00:00
|
|
|
|
''notes.sh -l | fzf --tac --with-nth="2..-1" --preview "notes.sh -p {}" --print-query --bind 'alt-enter:print-query' | xargs -o -d "\n" -n 2 notes.sh -f'';
|
2024-05-15 19:46:11 +00:00
|
|
|
|
vim = "emacs -nw --no-splash";
|
2023-10-25 23:31:53 +00:00
|
|
|
|
|
|
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-07-08 19:36:39 +00:00
|
|
|
|
xdg.mimeApps = {
|
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
|
|
defaultApplications = {
|
|
|
|
|
"text/html" = "firefox.desktop";
|
|
|
|
|
"x-scheme-handler/http" = "firefox.desktop";
|
|
|
|
|
"x-scheme-handler/https" = "firefox.desktop";
|
|
|
|
|
"x-scheme-handler/about" = "firefox.desktop";
|
|
|
|
|
"x-scheme-handler/unknown" = "firefox.desktop";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-04 16:45:18 +00:00
|
|
|
|
gtk = {
|
|
|
|
|
enable = true;
|
2023-09-30 22:07:32 +00:00
|
|
|
|
gtk3.extraConfig = { gtk-enable-animations = "0"; };
|
|
|
|
|
gtk4.extraConfig = { gtk-enable-animations = "0"; };
|
2023-08-04 16:45:18 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-07-08 19:36:39 +00:00
|
|
|
|
# Workaround for https://github.com/nix-community/home-manager/issues/5146
|
|
|
|
|
services.gpg-agent = {
|
|
|
|
|
enable = true;
|
|
|
|
|
pinentryPackage = pkgs.pinentry-gnome3;
|
2024-09-20 02:22:42 +00:00
|
|
|
|
enableExtraSocket = true;
|
2024-07-08 19:36:39 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-07-30 16:18:49 +00:00
|
|
|
|
programs.gpg = {
|
|
|
|
|
enable = true;
|
|
|
|
|
package = pkgs.gnupg;
|
2023-08-15 14:25:03 +00:00
|
|
|
|
publicKeys = [
|
2023-09-30 22:07:32 +00:00
|
|
|
|
{
|
|
|
|
|
source = ./gpg_public_key.asc;
|
|
|
|
|
trust = "ultimate";
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
source = ./pgp_keys/FB4809DC51A4F483.asc;
|
|
|
|
|
trust = "ultimate";
|
|
|
|
|
}
|
2024-10-28 20:45:28 +00:00
|
|
|
|
{
|
|
|
|
|
source = ./pgp_keys/60B2FF168764BED2D4ADE1BF7DE090DD4DB68232.asc;
|
|
|
|
|
trust = "ultimate";
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
source = ./pgp_keys/8311DCF21B41308C743FBFEA44B0C3FE7CD9EAE3.asc;
|
|
|
|
|
trust = "ultimate";
|
|
|
|
|
}
|
2023-08-15 14:25:03 +00:00
|
|
|
|
];
|
2023-09-30 22:07:32 +00:00
|
|
|
|
settings = { default-key = "0x0560020C9C577C1B"; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
mutableKeys = false;
|
|
|
|
|
mutableTrust = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
programs.git = {
|
|
|
|
|
enable = true;
|
2023-08-19 18:18:44 +00:00
|
|
|
|
package = pkgs.gitAndTools.gitFull; # needed for git send-email support
|
2023-07-30 16:18:49 +00:00
|
|
|
|
userName = "Konstantin Nazarov";
|
|
|
|
|
userEmail = "mail@knazarov.com";
|
|
|
|
|
signing = {
|
|
|
|
|
gpgPath = "${pkgs.gnupg}/bin/gpg2";
|
|
|
|
|
key = "0x0560020C9C577C1B";
|
|
|
|
|
signByDefault = true;
|
|
|
|
|
};
|
2024-09-20 02:22:42 +00:00
|
|
|
|
extraConfig = {
|
|
|
|
|
push = {
|
|
|
|
|
autoSetupRemote = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
accounts.email = {
|
|
|
|
|
maildirBasePath = "${config.users.users.knazarov.home}/Maildir";
|
|
|
|
|
accounts = {
|
2023-09-30 22:07:32 +00:00
|
|
|
|
personal = let account = "mail@knazarov.com";
|
|
|
|
|
in {
|
2023-07-30 16:18:49 +00:00
|
|
|
|
primary = true;
|
|
|
|
|
flavor = "fastmail.com";
|
|
|
|
|
address = account;
|
|
|
|
|
userName = account;
|
|
|
|
|
realName = "Konstantin Nazarov";
|
|
|
|
|
passwordCommand = "cat /run/secrets/fastmail_password";
|
|
|
|
|
gpg = {
|
|
|
|
|
key = "0x0560020C9C577C1B";
|
|
|
|
|
signByDefault = true;
|
|
|
|
|
};
|
|
|
|
|
mu.enable = true;
|
|
|
|
|
msmtp.enable = true;
|
|
|
|
|
mbsync = {
|
|
|
|
|
enable = true;
|
|
|
|
|
# Folders existing on the server, but not locally, will be created.
|
|
|
|
|
create = "maildir";
|
|
|
|
|
|
|
|
|
|
};
|
2024-05-15 19:46:11 +00:00
|
|
|
|
neomutt = { enable = true; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-15 19:46:11 +00:00
|
|
|
|
programs.neomutt = { enable = true; };
|
2023-09-30 22:07:32 +00:00
|
|
|
|
programs.mu = { enable = true; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
programs.msmtp.enable = true;
|
|
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
|
programs.mbsync = { enable = true; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
|
|
|
|
|
#services.easyeffects = {
|
|
|
|
|
# enable = true;
|
|
|
|
|
#};
|
|
|
|
|
|
|
|
|
|
services.swayidle = {
|
|
|
|
|
enable = true;
|
|
|
|
|
timeouts = [
|
2023-09-30 22:07:32 +00:00
|
|
|
|
{
|
|
|
|
|
timeout = 300;
|
|
|
|
|
command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
timeout = 600;
|
|
|
|
|
command = ''${pkgs.sway}/bin/swaymsg "output * dpms off"'';
|
|
|
|
|
resumeCommand = ''${pkgs.sway}/bin/swaymsg "output * dpms on"'';
|
|
|
|
|
}
|
2023-07-30 16:18:49 +00:00
|
|
|
|
];
|
2023-09-30 22:07:32 +00:00
|
|
|
|
events = [{
|
|
|
|
|
event = "before-sleep";
|
|
|
|
|
command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
|
|
|
|
|
}];
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-10-25 23:31:53 +00:00
|
|
|
|
services.emacs = {
|
|
|
|
|
enable = true;
|
|
|
|
|
package = my_emacs;
|
|
|
|
|
client.enable = true;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-30 16:18:49 +00:00
|
|
|
|
wayland.windowManager.sway = {
|
|
|
|
|
enable = true;
|
|
|
|
|
xwayland = true;
|
|
|
|
|
config = rec {
|
|
|
|
|
modifier = "Mod4";
|
|
|
|
|
terminal = "foot";
|
2023-09-30 22:07:32 +00:00
|
|
|
|
bars = [{ "command" = "waybar"; }];
|
2023-07-30 16:18:49 +00:00
|
|
|
|
keybindings = pkgs.lib.mkOptionDefault {
|
2023-09-30 22:07:32 +00:00
|
|
|
|
"XF86AudioRaiseVolume" =
|
|
|
|
|
"exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
|
|
|
|
"XF86AudioLowerVolume" =
|
|
|
|
|
"exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
2023-07-30 16:18:49 +00:00
|
|
|
|
"XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
2023-09-30 22:07:32 +00:00
|
|
|
|
"XF86AudioMicMute" =
|
|
|
|
|
"exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
2023-07-30 16:18:49 +00:00
|
|
|
|
"XF86MonBrightnessUp" = "exec brightnessctl s +5%";
|
|
|
|
|
"XF86MonBrightnessDown" = "exec brightnessctl s 5%-";
|
2023-10-25 23:31:53 +00:00
|
|
|
|
#"Mod4+Return" =
|
2024-03-14 10:13:21 +00:00
|
|
|
|
#"exec emacs --eval '(progn (setq confirm-kill-processes nil) (vterm))'";
|
2024-05-15 19:46:11 +00:00
|
|
|
|
#"Mod4+Return" = "exec emacsclient -c";
|
|
|
|
|
"Mod4+Return" = "exec foot";
|
2023-09-30 22:07:32 +00:00
|
|
|
|
"Mod4+space" =
|
|
|
|
|
"exec ${pkgs.foot}/bin/foot -T mylauncher -a mylauncher ${pkgs.q-sh}/bin/q";
|
|
|
|
|
"Mod4+p" =
|
|
|
|
|
"exec '${pkgs.grim}/bin/grim -g \"$$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png'";
|
2024-09-08 23:38:16 +00:00
|
|
|
|
"Mod4+o" =
|
|
|
|
|
"exec '${pkgs.kooha}/bin/kooha'";
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
output = {
|
2023-09-30 22:07:32 +00:00
|
|
|
|
"*" = { bg = "${./wallpaper.jpg} fill"; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
"Lenovo Group Limited LEN T32p-20 VNA4VRNY" = { scale = "1.5"; };
|
2024-09-20 02:22:42 +00:00
|
|
|
|
"LG Electronics LG TV SSCR2 0x01010101" = { mode = "1920x1080@60Hz"; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
input = {
|
|
|
|
|
"type:keyboard" = {
|
|
|
|
|
xkb_layout = "us,ru";
|
|
|
|
|
xkb_options = "grp:alt_space_toggle";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
gaps = {
|
|
|
|
|
inner = 10;
|
|
|
|
|
outer = 5;
|
|
|
|
|
};
|
2023-09-30 22:07:32 +00:00
|
|
|
|
colors.unfocused = {
|
|
|
|
|
border = "#dddddd";
|
|
|
|
|
background = "#dddddd";
|
|
|
|
|
text = "#888888";
|
|
|
|
|
indicator = "#888888";
|
|
|
|
|
childBorder = "#888888";
|
|
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
extraConfig = ''
|
2023-10-25 23:31:53 +00:00
|
|
|
|
for_window [title="as_toolbar"] floating enable
|
2023-07-30 16:18:49 +00:00
|
|
|
|
for_window [title="mylauncher"] floating enable
|
2023-08-21 22:42:02 +00:00
|
|
|
|
for_window [title="Firefox.*Sharing Indicator"] floating enable;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
default_border pixel 3
|
2024-10-28 20:45:28 +00:00
|
|
|
|
input 1386:885:Wacom_Intuos_M_Pen map_to_output DP-1
|
2024-10-30 21:49:16 +00:00
|
|
|
|
|
|
|
|
|
exec_always ${pkgs.networkmanagerapplet}/bin/nm-applet --indicator
|
2023-07-30 16:18:49 +00:00
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
programs.foot = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings = {
|
2024-05-11 16:20:32 +00:00
|
|
|
|
main = { font = "Source Code Pro:size=12"; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
|
|
|
|
|
colors = {
|
2024-05-11 16:20:32 +00:00
|
|
|
|
background = "ffffff";
|
|
|
|
|
foreground = "000000";
|
|
|
|
|
regular0 = "000000";
|
|
|
|
|
regular1 = "a60000";
|
|
|
|
|
regular2 = "005e00";
|
|
|
|
|
regular3 = "813e00";
|
|
|
|
|
regular4 = "0031a9";
|
|
|
|
|
regular5 = "721045";
|
|
|
|
|
regular6 = "00538b";
|
|
|
|
|
regular7 = "bfbfbf";
|
|
|
|
|
bright0 = "595959";
|
|
|
|
|
bright1 = "972500";
|
|
|
|
|
bright2 = "315b00";
|
|
|
|
|
bright3 = "70480f";
|
|
|
|
|
bright4 = "2544bb";
|
|
|
|
|
bright5 = "5317ac";
|
|
|
|
|
bright6 = "005a5f";
|
|
|
|
|
bright7 = "ffffff";
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
key-bindings = {
|
2023-09-30 22:07:32 +00:00
|
|
|
|
clipboard-copy = "Control+Insert";
|
|
|
|
|
clipboard-paste = "Shift+Insert";
|
|
|
|
|
primary-paste = "Control+Shift+v";
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
programs.waybar = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings = [{
|
2023-09-30 22:07:32 +00:00
|
|
|
|
layer = "top";
|
|
|
|
|
position = "top";
|
|
|
|
|
height = 24;
|
|
|
|
|
modules-left = [ "sway/workspaces" "sway/mode" ];
|
|
|
|
|
modules-center = [ "sway/window" ];
|
2024-11-02 22:05:34 +00:00
|
|
|
|
modules-right = [ "custom/maildir" "idle_inhibitor" "battery" "clock" "tray" ];
|
2023-09-30 22:07:32 +00:00
|
|
|
|
clock.format = "{:%Y-%m-%d %H:%M}";
|
2024-11-02 22:05:34 +00:00
|
|
|
|
"custom/maildir" = {
|
|
|
|
|
exec = "${./waybar_maildir.sh} /home/knazarov/Maildir/personal/Inbox/new knazarov";
|
|
|
|
|
format = " {} ";
|
|
|
|
|
return-type = "json";
|
|
|
|
|
};
|
|
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
|
battery = {
|
|
|
|
|
states = {
|
|
|
|
|
# good = 95;
|
|
|
|
|
warning = 30;
|
|
|
|
|
critical = 15;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
2023-09-30 22:07:32 +00:00
|
|
|
|
format = "{capacity}% {icon}";
|
|
|
|
|
format-charging = "{capacity}% ";
|
|
|
|
|
format-plugged = "{capacity}% ";
|
|
|
|
|
format-alt = "{time} {icon}";
|
|
|
|
|
format-icons = [ "" "" "" "" "" ];
|
|
|
|
|
};
|
|
|
|
|
idle_inhibitor = {
|
|
|
|
|
format = "{icon}";
|
|
|
|
|
format-icons = {
|
|
|
|
|
activated = "";
|
|
|
|
|
deactivated = "";
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
2023-09-30 22:07:32 +00:00
|
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
}];
|
|
|
|
|
};
|
2024-10-28 20:45:28 +00:00
|
|
|
|
#services.syncthing = { enable = true; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
home.pointerCursor = {
|
|
|
|
|
name = "Adwaita";
|
2024-09-08 23:38:16 +00:00
|
|
|
|
package = pkgs.adwaita-icon-theme;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
size = 24;
|
|
|
|
|
x11 = {
|
|
|
|
|
enable = true;
|
|
|
|
|
defaultCursor = "Adwaita";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
virtualisation = {
|
|
|
|
|
podman = {
|
|
|
|
|
enable = true;
|
|
|
|
|
dockerCompat = true;
|
2023-09-30 22:07:32 +00:00
|
|
|
|
defaultNetwork.settings = { dns_enabled = true; };
|
2023-07-30 16:18:49 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
2024-05-26 20:21:45 +00:00
|
|
|
|
services.udev.packages = [ pkgs.android-udev-rules
|
|
|
|
|
(pkgs.callPackage ./zsa-udev-rules.nix {})];
|
2023-08-14 21:50:06 +00:00
|
|
|
|
#udevadm info --query=all --name=/dev/sda1 | grep ID_SERIAL
|
2023-08-17 17:33:56 +00:00
|
|
|
|
services.udev.extraRules =
|
2023-09-30 22:07:32 +00:00
|
|
|
|
''ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", '' + ''
|
|
|
|
|
ENV{ID_FS_USAGE}=="filesystem", ENV{ID_SERIAL_SHORT}=="Hidizs_AP80PRO", ''
|
|
|
|
|
+ ''RUN{program}+="${pkgs.systemd}/bin/systemd-mount --owner knazarov ''
|
|
|
|
|
+ ''--no-block --automount=yes --collect $devnode /media"'';
|
2023-08-15 14:25:03 +00:00
|
|
|
|
|
|
|
|
|
systemd.timers."git_plan" = {
|
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
|
timerConfig = {
|
2023-09-30 22:07:32 +00:00
|
|
|
|
OnBootSec = "1h";
|
|
|
|
|
OnUnitActiveSec = "1h";
|
2023-08-15 14:25:03 +00:00
|
|
|
|
Unit = "git_plan.service";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
systemd.services."git_plan" = {
|
|
|
|
|
script = ''
|
2023-09-30 22:07:32 +00:00
|
|
|
|
${my_python}/bin/python3 -m git_plan -c /var/run/secrets/git_plan_config -r /var/run/secrets/git_plan_credentials oneshot
|
|
|
|
|
'';
|
2023-08-15 14:25:03 +00:00
|
|
|
|
serviceConfig = {
|
|
|
|
|
Type = "oneshot";
|
|
|
|
|
User = "knazarov";
|
2023-09-30 22:07:32 +00:00
|
|
|
|
StateDirectory = "git_plan";
|
|
|
|
|
Environment = "PYTHONUNBUFFERED=1";
|
2023-08-15 14:25:03 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
systemd.timers."git_plan_pr" = {
|
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
|
timerConfig = {
|
2023-09-30 22:07:32 +00:00
|
|
|
|
OnCalendar = "Mon,Tue,Wed,Thu,Fri *-*-* 10:00:00";
|
2023-08-15 14:25:03 +00:00
|
|
|
|
Unit = "git_plan_pr.service";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
systemd.services."git_plan_pr" = {
|
|
|
|
|
script = ''
|
2023-09-30 22:07:32 +00:00
|
|
|
|
${my_python}/bin/python3 -m git_plan -c /var/run/secrets/git_plan_config -r /var/run/secrets/git_plan_credentials pr
|
|
|
|
|
'';
|
2023-08-15 14:25:03 +00:00
|
|
|
|
serviceConfig = {
|
|
|
|
|
Type = "oneshot";
|
|
|
|
|
User = "knazarov";
|
2023-09-30 22:07:32 +00:00
|
|
|
|
StateDirectory = "git_plan";
|
|
|
|
|
Environment = "PYTHONUNBUFFERED=1";
|
2023-08-15 14:25:03 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
}
|