Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
bc18255229 | |||
91a32bfdeb | |||
d2bd664f4e | |||
73b02b4589 | |||
075237ed6f | |||
c213f82d04 | |||
3ed2aa4cc1 | |||
dc86d80a3a | |||
7df0351721 | |||
eaaf415299 | |||
80daeb3ba5 | |||
c9b5cb9b52 | |||
67279849d7 | |||
dec199a870 | |||
06dea9ce71 | |||
1a4be3cb75 | |||
d89757afb9 | |||
0b8e88f09d | |||
9ee0b504b1 | |||
3afeaa8934 | |||
7d7c00de4f | |||
1bd5b467ae | |||
a10568d5ac | |||
eac0e79ca3 | |||
f1b2a18a1d | |||
07512362f8 | |||
c36b061ce9 | |||
d0caeb0b57 | |||
00d0aff6f8 | |||
793790226b |
2
Justfile
2
Justfile
@ -21,4 +21,4 @@ generate format="install-iso" config="install-iso":
|
||||
nix shell nixpkgs#nixos-generators --command nixos-generate -f {{format}} --flake ./#{{config}}
|
||||
|
||||
vps:
|
||||
nixos-rebuild switch --flake ./#mailserver --target-host root@10.0.0.1
|
||||
nixos-rebuild switch --flake ./#vps --target-host root@37.205.13.29
|
||||
|
@ -1,8 +1,8 @@
|
||||
top@{ inputs, ... }: {
|
||||
top @ { inputs, ... }: {
|
||||
imports = [ ./nixos ./home ./packages ./overlays ./hardware-configurations ];
|
||||
systems = [ "x86_64-linux" ];
|
||||
flake.stateVersion = "24.05";
|
||||
perSystem = perSystem@{ system, ... }: {
|
||||
perSystem = { system, ... }: {
|
||||
config._module.args = {
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
|
42
flake.lock
42
flake.lock
@ -672,11 +672,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722462338,
|
||||
"narHash": "sha256-ss0G8t8RJVDewA3MyqgAlV951cWRK6EtVhVKEZ7J5LU=",
|
||||
"lastModified": 1725863684,
|
||||
"narHash": "sha256-HmdTBpuCsw35Ii35JUKO6AE6nae+kJliQb0XGd4hoLE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "6e090576c4824b16e8759ebca3958c5b09659ee8",
|
||||
"rev": "be47a2bdf278c57c2d05e747a13ed31cef54a037",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -737,11 +737,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722388081,
|
||||
"narHash": "sha256-gJkry8rSaaZw+d+frABPgVjqBznCa7Jr3A5YLChSR4o=",
|
||||
"lastModified": 1725674607,
|
||||
"narHash": "sha256-vTaoz2yRd9g3NZNKYufZeB8UJ381aBPmRV91lEmV37o=",
|
||||
"owner": "StevenBlack",
|
||||
"repo": "hosts",
|
||||
"rev": "d6039e35d071480c309363eff2690e8b963ab06a",
|
||||
"rev": "10b187280ec15374e4d2b28e7705046e7d535d91",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -806,11 +806,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722213035,
|
||||
"narHash": "sha256-FrJRRFbaJFm2iW1jddLbcSJwQmk3afMSwYm+7IBxeaw=",
|
||||
"lastModified": 1725237485,
|
||||
"narHash": "sha256-POpzmA7+ecCUEZsu2a5fgwYhJ60POzve+lMhxebmTz4=",
|
||||
"owner": "musnix",
|
||||
"repo": "musnix",
|
||||
"rev": "0e23bb501576ae18b4d19836a91e12c87e4931ee",
|
||||
"rev": "b5f3a47fd74193cb98c85cfeb6a25358150bdd90",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -951,11 +951,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1722421184,
|
||||
"narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=",
|
||||
"lastModified": 1725634671,
|
||||
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58",
|
||||
"rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -1068,11 +1068,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719994518,
|
||||
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
|
||||
"lastModified": 1725234343,
|
||||
"narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
|
||||
"rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -1128,11 +1128,11 @@
|
||||
"nixpkgs-24_05": "nixpkgs-24_05"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1721121314,
|
||||
"narHash": "sha256-zwc7YXga/1ppaZMWFreZykXtFwBgXodxUZiUx969r+g=",
|
||||
"lastModified": 1722877200,
|
||||
"narHash": "sha256-qgKDNJXs+od+1UbRy62uk7dYal3h98I4WojfIqMoGcg=",
|
||||
"owner": "simple-nixos-mailserver",
|
||||
"repo": "nixos-mailserver",
|
||||
"rev": "059b50b2e729729ea00c6831124d3837c494f3d5",
|
||||
"rev": "af7d3bf5daeba3fc28089b015c0dd43f06b176f2",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
@ -1248,11 +1248,11 @@
|
||||
},
|
||||
"vpsadminos": {
|
||||
"locked": {
|
||||
"lastModified": 1722101851,
|
||||
"narHash": "sha256-fM5Z8Qhk9/AbGYJ4VrJilGlFK9btBEF+ROtbYYJZJ1I=",
|
||||
"lastModified": 1725810385,
|
||||
"narHash": "sha256-+6UULi05KMHmLfhlrNGhMdLZUoQeC5Dc1nLFdINyeyI=",
|
||||
"owner": "vpsfreecz",
|
||||
"repo": "vpsadminos",
|
||||
"rev": "2c8ff8462a6f4aefb7bd2663d6ddbedd9d161f2c",
|
||||
"rev": "37c5eb47ca3f11deac83e4ada20a6c21d5487f29",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -20,7 +20,10 @@
|
||||
};
|
||||
sal = {
|
||||
url = "github:ivandimitrov8080/sal";
|
||||
inputs = { nixpkgs.follows = "nixpkgs"; ide.follows = "ide"; };
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
ide.follows = "ide";
|
||||
};
|
||||
};
|
||||
musnix = {
|
||||
url = "github:musnix/musnix";
|
||||
@ -35,5 +38,5 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
outputs = inputs: inputs.parts.lib.mkFlake { inherit inputs; } { imports = [ ./. ]; };
|
||||
outputs = inputs: inputs.parts.lib.mkFlake {inherit inputs;} {imports = [./.];};
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
top@{ ... }: {
|
||||
_: {
|
||||
flake.hardwareConfigurations = {
|
||||
nova = { lib, modulesPath, ... }: {
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
@ -12,8 +12,14 @@ top@{ ... }: {
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
fileSystems = {
|
||||
"/" = { device = "/dev/disk/by-uuid/47536cbe-7265-493b-a2e3-bbd376a6f9af"; fsType = "btrfs"; };
|
||||
"/boot" = { device = "/dev/disk/by-uuid/4C3C-993A"; fsType = "vfat"; };
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/47536cbe-7265-493b-a2e3-bbd376a6f9af";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/4C3C-993A";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
swapDevices = [ ];
|
||||
networking.useDHCP = lib.mkForce true;
|
||||
|
@ -1,19 +0,0 @@
|
||||
toplevel@{ inputs, withSystem, config, ... }:
|
||||
{
|
||||
flake.homeConfigurations.ivand = withSystem "x86_64-linux" (ctx@{ pkgs, ... }:
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules =
|
||||
let
|
||||
mods = config.flake.homeManagerModules;
|
||||
in
|
||||
with mods; [
|
||||
base
|
||||
ivand
|
||||
shell
|
||||
util
|
||||
swayland
|
||||
web
|
||||
];
|
||||
});
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
imports = [ ./modules ./configs ];
|
||||
imports = [./modules];
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
toplevel@{ moduleWithSystem, ... }: {
|
||||
toplevel @ { moduleWithSystem, ... }: {
|
||||
flake.homeManagerModules = {
|
||||
base = moduleWithSystem (
|
||||
top@{ ... }:
|
||||
perSystem@{ config, ... }: {
|
||||
_: { config, ... }: {
|
||||
programs.home-manager.enable = true;
|
||||
home.stateVersion = toplevel.config.flake.stateVersion;
|
||||
xdg = {
|
||||
@ -24,8 +23,7 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
}
|
||||
);
|
||||
ivand = moduleWithSystem (
|
||||
top@{ ... }:
|
||||
perSystem@{ pkgs, ... }: {
|
||||
_: { pkgs, ... }: {
|
||||
home = {
|
||||
username = "ivand";
|
||||
homeDirectory = "/home/ivand";
|
||||
@ -36,71 +34,148 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
git = with pkgs.lib; {
|
||||
userName = mkForce "Ivan Kirilov Dimitrov";
|
||||
userEmail = mkForce "ivan@idimitrov.dev";
|
||||
signing = mkForce { signByDefault = true; key = "ivan@idimitrov.dev"; };
|
||||
signing = mkForce {
|
||||
signByDefault = true;
|
||||
key = "ivan@idimitrov.dev";
|
||||
};
|
||||
};
|
||||
ssh = {
|
||||
matchBlocks = {
|
||||
vpsfree-ivand = { hostname = "10.0.0.1"; user = "ivand"; };
|
||||
vpsfree-root = { hostname = "10.0.0.1"; user = "root"; };
|
||||
vpsfree-ivand = {
|
||||
hostname = "10.0.0.1";
|
||||
user = "ivand";
|
||||
};
|
||||
vpsfree-root = {
|
||||
hostname = "10.0.0.1";
|
||||
user = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
util = moduleWithSystem (
|
||||
top@{ ... }:
|
||||
perSystem@{ pkgs, config, ... }: {
|
||||
_: { pkgs
|
||||
, config
|
||||
, ...
|
||||
}: {
|
||||
home = {
|
||||
packages = with pkgs; [ openssl mlocate uutils-coreutils-noprefix speedtest-cli ];
|
||||
sessionVariables = { PAGER = "bat"; BAT_THEME = "catppuccin-mocha"; };
|
||||
sessionVariables = {
|
||||
PAGER = "bat";
|
||||
BAT_THEME = "catppuccin-mocha";
|
||||
};
|
||||
};
|
||||
programs = {
|
||||
password-store = { enable = true; package = pkgs.pass.withExtensions (e: with e; [ pass-otp pass-file ]); settings = { PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store"; }; };
|
||||
password-store = {
|
||||
enable = true;
|
||||
package = pkgs.pass.withExtensions (e: with e; [ pass-otp pass-file ]);
|
||||
settings = { PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store"; };
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
delta.enable = true;
|
||||
extraConfig = { color.ui = "auto"; pull.rebase = true; push.autoSetupRemote = true; };
|
||||
aliases = { a = "add ."; c = "commit"; d = "diff --cached"; p = "push"; pa = "!git remote | xargs -L1 git push --all"; };
|
||||
extraConfig = {
|
||||
color.ui = "auto";
|
||||
pull.rebase = true;
|
||||
push.autoSetupRemote = true;
|
||||
};
|
||||
aliases = {
|
||||
a = "add .";
|
||||
c = "commit";
|
||||
d = "diff --cached";
|
||||
p = "push";
|
||||
pa = "!git remote | xargs -L1 git push --all";
|
||||
};
|
||||
};
|
||||
tealdeer = {
|
||||
enable = true;
|
||||
settings = { display = { compact = true; }; updates = { auto_update = true; }; };
|
||||
settings = {
|
||||
display = { compact = true; };
|
||||
updates = { auto_update = true; };
|
||||
};
|
||||
};
|
||||
bottom = {
|
||||
enable = true;
|
||||
settings = {
|
||||
flags = { rate = "250ms"; };
|
||||
row = [
|
||||
{ ratio = 40; child = [{ type = "cpu"; } { type = "mem"; } { type = "net"; }]; }
|
||||
{ ratio = 35; child = [{ type = "temp"; } { type = "disk"; }]; }
|
||||
{ ratio = 40; child = [{ type = "proc"; default = true; }]; }
|
||||
{
|
||||
ratio = 40;
|
||||
child = [{ type = "cpu"; } { type = "mem"; } { type = "net"; }];
|
||||
}
|
||||
{
|
||||
ratio = 35;
|
||||
child = [{ type = "temp"; } { type = "disk"; }];
|
||||
}
|
||||
{
|
||||
ratio = 40;
|
||||
child = [
|
||||
{
|
||||
type = "proc";
|
||||
default = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
fzf = { enable = true; enableBashIntegration = true; enableZshIntegration = true; };
|
||||
nix-index = { enable = true; enableZshIntegration = false; enableBashIntegration = false; };
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
nix-index = {
|
||||
enable = true;
|
||||
enableZshIntegration = false;
|
||||
enableBashIntegration = false;
|
||||
};
|
||||
bat = {
|
||||
enable = true;
|
||||
themes =
|
||||
let
|
||||
catppuccin = pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "bat"; rev = "82e7ca555f805b53d2b377390e4ab38c20282e83"; sha256 = "sha256-/Ob9iCVyjJDBCXlss9KwFQTuxybmSSzYRBZxOT10PZg="; };
|
||||
catppuccin = pkgs.fetchFromGitHub {
|
||||
owner = "catppuccin";
|
||||
repo = "bat";
|
||||
rev = "82e7ca555f805b53d2b377390e4ab38c20282e83";
|
||||
sha256 = "sha256-/Ob9iCVyjJDBCXlss9KwFQTuxybmSSzYRBZxOT10PZg=";
|
||||
};
|
||||
in
|
||||
{
|
||||
catppuccin-mocha = { src = catppuccin; file = "themes/Catppuccin Mocha.tmTheme"; };
|
||||
catppuccin-macchiato = { src = catppuccin; file = "themes/Catppuccin Macchiato.tmTheme"; };
|
||||
catppuccin-frappe = { src = catppuccin; file = "themes/Catppuccin Frappe.tmTheme"; };
|
||||
catppuccin-latte = { src = catppuccin; file = "themes/Catppuccin Latte.tmTheme"; };
|
||||
catppuccin-mocha = {
|
||||
src = catppuccin;
|
||||
file = "themes/Catppuccin Mocha.tmTheme";
|
||||
};
|
||||
catppuccin-macchiato = {
|
||||
src = catppuccin;
|
||||
file = "themes/Catppuccin Macchiato.tmTheme";
|
||||
};
|
||||
catppuccin-frappe = {
|
||||
src = catppuccin;
|
||||
file = "themes/Catppuccin Frappe.tmTheme";
|
||||
};
|
||||
catppuccin-latte = {
|
||||
src = catppuccin;
|
||||
file = "themes/Catppuccin Latte.tmTheme";
|
||||
};
|
||||
};
|
||||
};
|
||||
ssh.enable = true;
|
||||
gpg.enable = true;
|
||||
};
|
||||
services = { gpg-agent = { enable = true; enableBashIntegration = true; enableZshIntegration = true; enableNushellIntegration = true; pinentryPackage = pkgs.pinentry-qt; }; };
|
||||
services = {
|
||||
gpg-agent = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
enableNushellIntegration = true;
|
||||
pinentryPackage = pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
shell = moduleWithSystem (
|
||||
top@{ ... }:
|
||||
perSystem@{ pkgs, ... }: {
|
||||
_: { pkgs, ... }: {
|
||||
programs =
|
||||
let
|
||||
shellAliases = {
|
||||
@ -140,10 +215,17 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
};
|
||||
nushell = {
|
||||
enable = true;
|
||||
environmentVariables = { config = '' { show_banner: false, completions: { quick: false partial: false algorithm: "prefix" } } ''; };
|
||||
shellAliases = { gcal = '' bash -c "cal $(date +%Y)" ''; la = "ls -al"; dev = "nix develop --command $env.SHELL"; };
|
||||
environmentVariables = { config = ''{ show_banner: false, completions: { quick: false partial: false algorithm: "prefix" } } ''; };
|
||||
shellAliases = {
|
||||
gcal = ''bash -c "cal $(date +%Y)" '';
|
||||
la = "ls -al";
|
||||
dev = "nix develop --command $env.SHELL";
|
||||
};
|
||||
};
|
||||
kitty.shellIntegration = {
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
kitty.shellIntegration = { enableBashIntegration = true; enableZshIntegration = true; };
|
||||
tmux = {
|
||||
enable = true;
|
||||
clock24 = true;
|
||||
@ -157,7 +239,12 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
set-option -a terminal-features 'screen-256color:RGB'
|
||||
'';
|
||||
};
|
||||
starship = { enable = true; enableNushellIntegration = true; enableZshIntegration = true; enableBashIntegration = true; };
|
||||
starship = {
|
||||
enable = true;
|
||||
enableNushellIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
eza = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
@ -176,11 +263,18 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
}
|
||||
);
|
||||
swayland = moduleWithSystem (
|
||||
top@{ ... }:
|
||||
perSystem@{ pkgs, config, ... }: {
|
||||
_: { pkgs
|
||||
, config
|
||||
, ...
|
||||
}: {
|
||||
home = {
|
||||
packages = with pkgs; [ audacity gimp grim libnotify libreoffice-qt mupdf slurp transmission_4 wl-clipboard xdg-user-dirs xdg-utils xwayland ];
|
||||
pointerCursor = with pkgs; { name = "catppuccin-mocha-green-cursors"; package = catppuccin-cursors.mochaGreen; size = 24; gtk.enable = true; };
|
||||
packages = with pkgs; [ audacity gimp grim libnotify libreoffice-qt mupdf slurp transmission_4 wl-clipboard xdg-user-dirs xdg-utils xwayland telegram-desktop ];
|
||||
pointerCursor = with pkgs; {
|
||||
name = "catppuccin-mocha-green-cursors";
|
||||
package = catppuccin-cursors.mochaGreen;
|
||||
size = 24;
|
||||
gtk.enable = true;
|
||||
};
|
||||
};
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
@ -213,17 +307,21 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
"${modifier}+Shift+c" = "kill";
|
||||
"${modifier}+Shift+q" = "exit";
|
||||
};
|
||||
input = { "*" = { xkb_layout = "us,bg"; xkb_options = "grp:win_space_toggle"; xkb_variant = ",phonetic"; }; };
|
||||
input = {
|
||||
"*" = {
|
||||
xkb_layout = "us,bg";
|
||||
xkb_options = "grp:win_space_toggle";
|
||||
xkb_variant = ",phonetic";
|
||||
};
|
||||
};
|
||||
};
|
||||
swaynag = { enable = config.wayland.windowManager.sway.enable; };
|
||||
swaynag = { inherit (config.wayland.windowManager.sway) enable; };
|
||||
};
|
||||
programs = {
|
||||
waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar =
|
||||
let
|
||||
in
|
||||
{
|
||||
layer = "top";
|
||||
position = "top";
|
||||
@ -234,28 +332,47 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
modules-center = [ "clock#week" "clock#year" "clock#time" ];
|
||||
modules-right = [ "network" "pulseaudio" "memory" "cpu" "battery" ];
|
||||
|
||||
"clock#time" = { format = "{:%H:%M:%S}"; interval = 1; tooltip = false; };
|
||||
"clock#week" = { format = "{:%a}"; tooltip = false; };
|
||||
"clock#year" = { format = "{:%Y-%m-%d}"; tooltip = false; };
|
||||
"clock#time" = {
|
||||
format = "{:%H:%M:%S}";
|
||||
interval = 1;
|
||||
tooltip = false;
|
||||
};
|
||||
"clock#week" = {
|
||||
format = "{:%a}";
|
||||
tooltip = false;
|
||||
};
|
||||
"clock#year" = {
|
||||
format = "{:%Y-%m-%d}";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
battery = {
|
||||
format = "{icon} <span color='#cdd6f4'>{capacity}% {time}</span>";
|
||||
format-time = " {H} h {M} m";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
states = { warning = 30; critical = 15; };
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
cpu = { format = "<span color='#74c7ec'></span> {usage}%"; };
|
||||
|
||||
memory = { format = "<span color='#89b4fa'></span> {percentage}%"; interval = 5; };
|
||||
memory = {
|
||||
format = "<span color='#89b4fa'></span> {percentage}%";
|
||||
interval = 5;
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
format = "<span color='#a6e3a1'>{icon}</span> {volume}% | {format_source}";
|
||||
format-muted = "<span color='#f38ba8'></span> {volume}% | {format_source}";
|
||||
format-source = "{volume}% <span color='#a6e3a1'></span>";
|
||||
format-source-muted = "{volume}% <span color='#f38ba8'></span>";
|
||||
format-icons = { headphone = ""; default = [ "" "" "" ]; };
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
default = [ "" "" "" ];
|
||||
};
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
@ -268,10 +385,16 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
"sway/workspaces" = { disable-scroll = true; all-outputs = true; };
|
||||
"sway/workspaces" = {
|
||||
disable-scroll = true;
|
||||
all-outputs = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd = { enable = true; target = "sway-session.target"; };
|
||||
systemd = {
|
||||
enable = true;
|
||||
target = "sway-session.target";
|
||||
};
|
||||
style = ''
|
||||
@define-color rosewater #f5e0dc;
|
||||
@define-color flamingo #f2cdcd;
|
||||
@ -401,12 +524,14 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
''
|
||||
;
|
||||
'';
|
||||
};
|
||||
swaylock = {
|
||||
enable = true;
|
||||
settings = { show-failed-attempts = true; image = config.home.homeDirectory + "/pic/bg.png"; };
|
||||
settings = {
|
||||
show-failed-attempts = true;
|
||||
image = config.home.homeDirectory + "/pic/bg.png";
|
||||
};
|
||||
};
|
||||
rofi = {
|
||||
enable = true;
|
||||
@ -426,22 +551,52 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
};
|
||||
kitty = {
|
||||
enable = true;
|
||||
font = { package = pkgs.fira-code; name = "FiraCodeNFM-Reg"; };
|
||||
settings = { background_opacity = "0.90"; cursor_shape = "beam"; };
|
||||
font = {
|
||||
package = pkgs.fira-code;
|
||||
name = "FiraCodeNFM-Reg";
|
||||
};
|
||||
settings = {
|
||||
background_opacity = "0.90";
|
||||
cursor_shape = "beam";
|
||||
};
|
||||
};
|
||||
imv = {
|
||||
enable = true;
|
||||
settings = { options.fullscreen = true; };
|
||||
};
|
||||
mpv = {
|
||||
enable = true;
|
||||
scripts = with pkgs.mpvScripts; [ uosc thumbfast ];
|
||||
};
|
||||
bash.profileExtra = ''[ "$(tty)" = "/dev/tty1" ] && exec sway '';
|
||||
zsh.loginExtra = ''[ "$(tty)" = "/dev/tty1" ] && exec sway '';
|
||||
nushell.loginFile.text = ''if (tty) == "/dev/tty1" { sway } '';
|
||||
};
|
||||
services = {
|
||||
mako.enable = true;
|
||||
cliphist = {
|
||||
enable = true;
|
||||
systemdTarget = "sway-session.target";
|
||||
};
|
||||
imv = { enable = true; settings = { options.fullscreen = true; }; };
|
||||
mpv = { enable = true; scripts = with pkgs.mpvScripts; [ uosc thumbfast ]; };
|
||||
bash.profileExtra = '' [ "$(tty)" = "/dev/tty1" ] && exec sway '';
|
||||
zsh.loginExtra = '' [ "$(tty)" = "/dev/tty1" ] && exec sway '';
|
||||
nushell.loginFile.text = '' if (tty) == "/dev/tty1" { sway } '';
|
||||
};
|
||||
services = { mako.enable = true; cliphist = { enable = true; systemdTarget = "sway-session.target"; }; };
|
||||
systemd.user = {
|
||||
timers = { rbingwp = { Timer = { OnCalendar = "*-*-* 10:00:00"; Persistent = true; }; Install = { WantedBy = [ "timers.target" ]; }; }; };
|
||||
timers = {
|
||||
rbingwp = {
|
||||
Timer = {
|
||||
OnCalendar = "*-*-* 10:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
Install = { WantedBy = [ "timers.target" ]; };
|
||||
};
|
||||
};
|
||||
services = {
|
||||
wpd = {
|
||||
Install = { WantedBy = [ "sway-session.target" ]; };
|
||||
Unit = { Description = "Switch background every x minutes"; After = "graphical-session-pre.target"; PartOf = "graphical-session.target"; };
|
||||
Unit = {
|
||||
Description = "Switch background every x minutes";
|
||||
After = "graphical-session-pre.target";
|
||||
PartOf = "graphical-session.target";
|
||||
};
|
||||
Service = {
|
||||
ExecStart = [ "${pkgs.wpd}/bin/wpd" ];
|
||||
};
|
||||
@ -464,18 +619,27 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
}
|
||||
);
|
||||
web = moduleWithSystem (
|
||||
top@{ ... }:
|
||||
perSystem@{ ... }: {
|
||||
_: _: {
|
||||
programs = {
|
||||
browserpass.enable = true;
|
||||
firefox = {
|
||||
enable = true;
|
||||
profiles.ivand = {
|
||||
id = 0;
|
||||
search = { default = "DuckDuckGo"; privateDefault = "DuckDuckGo"; force = true; };
|
||||
search = {
|
||||
default = "DuckDuckGo";
|
||||
privateDefault = "DuckDuckGo";
|
||||
force = true;
|
||||
};
|
||||
bookmarks = [
|
||||
{ name = "home-options"; url = "https://nix-community.github.io/home-manager/options.xhtml"; }
|
||||
{ name = "nixvim-docs"; url = "https://nix-community.github.io/nixvim/"; }
|
||||
{
|
||||
name = "home-options";
|
||||
url = "https://nix-community.github.io/home-manager/options.xhtml";
|
||||
}
|
||||
{
|
||||
name = "nixvim-docs";
|
||||
url = "https://nix-community.github.io/nixvim/";
|
||||
}
|
||||
];
|
||||
settings = {
|
||||
"general.smoothScroll" = true;
|
||||
@ -499,17 +663,51 @@ toplevel@{ moduleWithSystem, ... }: {
|
||||
TranslateEnabled = false;
|
||||
SearchBar = "unified";
|
||||
SearchSuggestEnabled = false;
|
||||
SanitizeOnShutdown = { Cache = true; FormData = true; Locked = true; Cookies = false; Downloads = false; History = false; Sessions = false; SiteSettings = false; OfflineApps = true; };
|
||||
FirefoxHome = { Search = true; Pocket = false; Snippets = false; TopSites = false; Highlights = false; };
|
||||
UserMessaging = { ExtensionRecommendations = false; FeatureRecommendations = false; UrlbarInterventions = false; MoreFromMozilla = false; SkipOnboarding = true; };
|
||||
SanitizeOnShutdown = {
|
||||
Cache = true;
|
||||
FormData = true;
|
||||
Locked = true;
|
||||
Cookies = false;
|
||||
Downloads = false;
|
||||
History = false;
|
||||
Sessions = false;
|
||||
SiteSettings = false;
|
||||
OfflineApps = true;
|
||||
};
|
||||
FirefoxHome = {
|
||||
Search = true;
|
||||
Pocket = false;
|
||||
Snippets = false;
|
||||
TopSites = false;
|
||||
Highlights = false;
|
||||
};
|
||||
UserMessaging = {
|
||||
ExtensionRecommendations = false;
|
||||
FeatureRecommendations = false;
|
||||
UrlbarInterventions = false;
|
||||
MoreFromMozilla = false;
|
||||
SkipOnboarding = true;
|
||||
};
|
||||
|
||||
Handlers = {
|
||||
schemes = {
|
||||
mailto = { action = "useHelperApp"; ask = false; handlers = [{ name = "RoundCube"; uriTemplate = "https://mail.idimitrov.dev/?_task=mail&_action=compose&_to=%s"; }]; };
|
||||
mailto = {
|
||||
action = "useHelperApp";
|
||||
ask = false;
|
||||
handlers = [
|
||||
{
|
||||
name = "RoundCube";
|
||||
uriTemplate = "https://mail.idimitrov.dev/?_task=mail&_action=compose&_to=%s";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
chromium = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
xdg.mimeApps.defaultApplications = {
|
||||
"text/html" = "firefox.desktop";
|
||||
|
@ -1,283 +0,0 @@
|
||||
{ config, pkgs, ... }: {
|
||||
|
||||
fileSystems."/mnt/export1981" = {
|
||||
device = "172.16.128.47:/nas/5490";
|
||||
fsType = "nfs";
|
||||
options = [ "nofail" ];
|
||||
};
|
||||
|
||||
security = {
|
||||
acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "security@idimitrov.dev";
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
nameservers = [ "127.0.0.1" "::1" ];
|
||||
dhcpcd.extraConfig = "nohook resolv.conf";
|
||||
firewall = pkgs.lib.mkForce {
|
||||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
25 # smtp
|
||||
465 # smtps
|
||||
80 # http
|
||||
443 # https
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
25
|
||||
465
|
||||
80
|
||||
443
|
||||
51820 # wireguard
|
||||
];
|
||||
extraCommands = ''
|
||||
iptables -N vpn # create a new chain named vpn
|
||||
iptables -A vpn --src 10.0.0.2 -j ACCEPT # allow
|
||||
iptables -A vpn --src 10.0.0.3 -j ACCEPT # allow
|
||||
iptables -A vpn --src 10.0.0.4 -j ACCEPT # allow
|
||||
iptables -A vpn -j DROP # drop everyone else
|
||||
iptables -I INPUT -m tcp -p tcp --dport 22 -j vpn
|
||||
'';
|
||||
extraStopCommands = ''
|
||||
iptables -F vpn
|
||||
iptables -D INPUT -m tcp -p tcp --dport 22 -j vpn
|
||||
iptables -X vpn
|
||||
'';
|
||||
};
|
||||
nat = {
|
||||
enable = true;
|
||||
enableIPv6 = true;
|
||||
externalInterface = "venet0";
|
||||
internalInterfaces = [ "wg0" ];
|
||||
};
|
||||
wg-quick.interfaces = {
|
||||
wg0 = {
|
||||
address = [ "10.0.0.1/32" ];
|
||||
listenPort = 51820;
|
||||
privateKeyFile = "/etc/wireguard/privatekey";
|
||||
postUp = ''
|
||||
${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -j ACCEPT
|
||||
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.0.0.1/24 -o venet0 -j MASQUERADE
|
||||
${pkgs.iptables}/bin/ip6tables -A FORWARD -i wg0 -j ACCEPT
|
||||
${pkgs.iptables}/bin/ip6tables -t nat -A POSTROUTING -s fdc9:281f:04d7:9ee9::1/64 -o venet0 -j MASQUERADE
|
||||
'';
|
||||
preDown = ''
|
||||
${pkgs.iptables}/bin/iptables -D FORWARD -i wg0 -j ACCEPT
|
||||
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.0.0.1/24 -o venet0 -j MASQUERADE
|
||||
${pkgs.iptables}/bin/ip6tables -D FORWARD -i wg0 -j ACCEPT
|
||||
${pkgs.iptables}/bin/ip6tables -t nat -D POSTROUTING -s fdc9:281f:04d7:9ee9::1/64 -o venet0 -j MASQUERADE
|
||||
'';
|
||||
peers = [
|
||||
{
|
||||
publicKey = "kI93V0dVKSqX8hxMJHK5C0c1hEDPQTgPQDU8TKocVgo=";
|
||||
allowedIPs = [ "10.0.0.2/32" ];
|
||||
}
|
||||
{
|
||||
publicKey = "RqTsFxFCcgYsytcDr+jfEoOA5UNxa1ZzGlpx6iuTpXY=";
|
||||
allowedIPs = [ "10.0.0.3/32" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users = {
|
||||
users.ivand = {
|
||||
isNormalUser = true;
|
||||
hashedPassword =
|
||||
"$2b$05$hPrPcewxj4qjLCRQpKBAu.FKvKZdIVlnyn4uYsWE8lc21Jhvc9jWG";
|
||||
extraGroups = [ "wheel" "adm" "mlocate" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
''
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICcLkzuCoBEg+wq/H+hkrv6pLJ8J5BejaNJVNnymlnlo ivan@idimitrov.dev
|
||||
''
|
||||
];
|
||||
};
|
||||
extraGroups = { mlocate = { }; };
|
||||
};
|
||||
|
||||
services = {
|
||||
dovecot2.sieve.extensions = [ "fileinto" ];
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = "prohibit-password";
|
||||
};
|
||||
};
|
||||
roundcube = {
|
||||
enable = true;
|
||||
package = pkgs.roundcube.withPlugins (plugins: [ plugins.persistent_login ]);
|
||||
plugins = [
|
||||
"persistent_login"
|
||||
];
|
||||
hostName = "${config.mailserver.fqdn}";
|
||||
extraConfig = ''
|
||||
$config['smtp_host'] = "tls://${config.mailserver.fqdn}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
};
|
||||
postgresql = {
|
||||
enable = true;
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "root";
|
||||
ensureClauses = {
|
||||
superuser = true;
|
||||
createrole = true;
|
||||
createdb = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
gitea = {
|
||||
enable = true;
|
||||
appName = "src";
|
||||
database = {
|
||||
type = "postgres";
|
||||
};
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "src.idimitrov.dev";
|
||||
ROOT_URL = "https://src.idimitrov.dev/";
|
||||
HTTP_PORT = 3001;
|
||||
};
|
||||
repository = {
|
||||
DEFAULT_BRANCH = "master";
|
||||
};
|
||||
service = {
|
||||
DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
dnscrypt-proxy2 = {
|
||||
enable = true;
|
||||
settings = {
|
||||
cache = false;
|
||||
ipv4_servers = true;
|
||||
ipv6_servers = true;
|
||||
dnscrypt_servers = true;
|
||||
doh_servers = false;
|
||||
odoh_servers = false;
|
||||
require_dnssec = true;
|
||||
require_nolog = true;
|
||||
require_nofilter = true;
|
||||
anonymized_dns = {
|
||||
routes = [{ server_name = "*"; via = [ "sdns://gQ8yMTcuMTM4LjIyMC4yNDM" ]; }];
|
||||
};
|
||||
sources.public-resolvers = {
|
||||
urls = [
|
||||
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
||||
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
|
||||
];
|
||||
cache_file = "/var/lib/dnscrypt-proxy/public-resolvers.md";
|
||||
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
||||
};
|
||||
};
|
||||
};
|
||||
nginx =
|
||||
let
|
||||
webshiteConfig = ''
|
||||
add_header 'Referrer-Policy' 'origin-when-cross-origin';
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
'';
|
||||
restrictToVpn = ''
|
||||
allow 10.0.0.2/32;
|
||||
allow 10.0.0.3/32;
|
||||
allow 10.0.0.4/32;
|
||||
deny all;
|
||||
'';
|
||||
extensions = [ "html" "txt" "png" "jpg" "jpeg" ];
|
||||
serveStatic = exts: ''
|
||||
try_files $uri $uri/ ${pkgs.lib.strings.concatStringsSep " " (builtins.map (x: "$uri." + "${x}") exts)} =404;
|
||||
'';
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
|
||||
virtualHosts = {
|
||||
"idimitrov.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
root = "${pkgs.webshite}";
|
||||
extraConfig = serveStatic extensions;
|
||||
};
|
||||
extraConfig = webshiteConfig;
|
||||
};
|
||||
"www.idimitrov.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
root = "${pkgs.webshite}";
|
||||
extraConfig = serveStatic extensions;
|
||||
};
|
||||
extraConfig = webshiteConfig;
|
||||
};
|
||||
"${config.mailserver.fqdn}" = {
|
||||
extraConfig = restrictToVpn;
|
||||
};
|
||||
"src.idimitrov.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:3001";
|
||||
};
|
||||
};
|
||||
"pic.idimitrov.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
root = "/var/pic";
|
||||
extraConfig = ''
|
||||
autoindex on;
|
||||
${serveStatic ["png"]}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd = {
|
||||
timers = {
|
||||
bingwp = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 10:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
services = {
|
||||
bingwp = {
|
||||
description = "Download bing image of the day";
|
||||
script = ''
|
||||
${pkgs.nushell}/bin/nu -c "http get ('https://bing.com' + ((http get https://www.bing.com/HPImageArchive.aspx?format=js&n=1).images.0.url)) | save ('/var/pic' | path join ( [ (date now | format date '%Y-%m-%d'), '.png' ] | str join ))"
|
||||
${pkgs.nushell}/bin/nu -c "${pkgs.toybox}/bin/ln -sf (ls /var/pic | where type == file | get name | sort | last) /var/pic/latest.png"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
mailserver = {
|
||||
enable = true;
|
||||
localDnsResolver = false;
|
||||
fqdn = "mail.idimitrov.dev";
|
||||
domains = [ "idimitrov.dev" "mail.idimitrov.dev" ];
|
||||
loginAccounts = {
|
||||
"ivan@idimitrov.dev" = {
|
||||
hashedPassword = "$2b$05$rTVIQD98ogXeCBKdk/YufulWHqpMCAlb7SHDPlh5y8Xbukoa/uQLm";
|
||||
aliases = [ "admin@idimitrov.dev" ];
|
||||
};
|
||||
"security@idimitrov.dev" = {
|
||||
hashedPassword = "$2b$05$rTVIQD98ogXeCBKdk/YufulWHqpMCAlb7SHDPlh5y8Xbukoa/uQLm";
|
||||
};
|
||||
};
|
||||
certificateScheme = "acme-nginx";
|
||||
hierarchySeparator = "/";
|
||||
};
|
||||
}
|
@ -1,30 +1,41 @@
|
||||
toplevel@{ inputs, withSystem, ... }:
|
||||
toplevel @ { inputs
|
||||
, withSystem
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
mods = toplevel.config.flake.nixosModules;
|
||||
hardwareConfigurations = toplevel.config.flake.hardwareConfigurations;
|
||||
essential = with mods; [ grub base shell security wireless wireguard ];
|
||||
inherit (toplevel.config.flake) hardwareConfigurations;
|
||||
essential = with mods; [ grub base shell security wireless intranet ];
|
||||
desktop = with mods; [ sound wayland ];
|
||||
configWithModules = { hardware ? { nixpkgs.hostPlatform = system; }, modules }: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs inputs' pkgs;
|
||||
packages = config.packages;
|
||||
configWithModules =
|
||||
{ hardware ? { nixpkgs.hostPlatform = system; }
|
||||
, modules
|
||||
,
|
||||
}:
|
||||
withSystem system ({ inputs', pkgs, ... }:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs inputs' pkgs;
|
||||
};
|
||||
modules = [ hardware ] ++ modules;
|
||||
});
|
||||
novaConfig = mods:
|
||||
configWithModules {
|
||||
hardware = hardwareConfigurations.nova;
|
||||
modules = essential ++ desktop ++ mods;
|
||||
};
|
||||
modules = [ hardware ] ++ modules;
|
||||
});
|
||||
novaConfig = mods: configWithModules { hardware = hardwareConfigurations.nova; modules = essential ++ desktop ++ mods; };
|
||||
installer = conf: conf // { hardware = import /mnt/etc/nixos/hardware-configuration.nix; };
|
||||
in
|
||||
{
|
||||
flake.nixosConfigurations = rec {
|
||||
flake.nixosConfigurations = {
|
||||
nova = novaConfig [ mods.ivand ];
|
||||
nova-music = novaConfig (with mods; [ ivand music ]);
|
||||
nova-crypto = novaConfig (with mods; [ ivand cryptocurrency ]);
|
||||
nova-nonya = novaConfig (with mods; [ ivand anon cryptocurrency ]);
|
||||
nova-ai = novaConfig (with mods; [ ivand ai ]);
|
||||
install-iso = configWithModules { modules = (with mods; [ grub base shell wireless ]); };
|
||||
mailserver = configWithModules { modules = (with mods; [ base shell security vps ]); };
|
||||
stara-miner = configWithModules { modules = (with mods; [ base shell security monero-miner ]); };
|
||||
stara-miner-installer = installer stara-miner;
|
||||
nova-containers = novaConfig (with mods; [ ivand containers ]);
|
||||
install-iso = configWithModules { modules = with mods; [ grub base shell wireless ]; };
|
||||
vps = configWithModules { modules = with mods; [ base shell security vps mailserver nginx wireguard-output anonymous-dns firewall rest ]; };
|
||||
stara-miner = configWithModules { modules = essential ++ [ mods.monero-miner ]; };
|
||||
};
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{ ... }: {
|
||||
imports = [ ./modules ./configs ];
|
||||
{...}: {
|
||||
imports = [./modules ./configs];
|
||||
}
|
||||
|
@ -1,18 +1,28 @@
|
||||
top@{ inputs, moduleWithSystem, ... }: {
|
||||
top @ { inputs, moduleWithSystem, ... }: {
|
||||
flake.nixosModules = {
|
||||
grub = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
|
||||
grub = moduleWithSystem (_: { pkgs, ... }: {
|
||||
boot = {
|
||||
loader = {
|
||||
grub =
|
||||
let
|
||||
theme = pkgs.sleek-grub-theme.override { withBanner = "Hello Ivan"; withStyle = "bigSur"; };
|
||||
theme = pkgs.sleek-grub-theme.override {
|
||||
withBanner = "Hello Ivan";
|
||||
withStyle = "bigSur";
|
||||
};
|
||||
in
|
||||
{ enable = pkgs.lib.mkDefault true; useOSProber = true; efiSupport = true; device = "nodev"; theme = theme; splashImage = "${theme}/background.png"; };
|
||||
efi = { canTouchEfiVariables = true; };
|
||||
{
|
||||
inherit theme;
|
||||
enable = pkgs.lib.mkDefault true;
|
||||
useOSProber = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
splashImage = "${theme}/background.png";
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
});
|
||||
base = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
|
||||
base = moduleWithSystem (_: { pkgs, ... }: {
|
||||
imports = [ inputs.hosts.nixosModule ];
|
||||
system.stateVersion = top.config.flake.stateVersion;
|
||||
nix = { extraOptions = ''experimental-features = nix-command flakes''; };
|
||||
@ -25,14 +35,26 @@ top@{ inputs, moduleWithSystem, ... }: {
|
||||
enableAllTerminfo = true;
|
||||
};
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
programs = { zsh.enable = true; nix-ld.enable = true; };
|
||||
programs = {
|
||||
zsh.enable = true;
|
||||
nix-ld.enable = true;
|
||||
};
|
||||
services = {
|
||||
dbus.enable = true;
|
||||
logind = { killUserProcesses = true; powerKeyLongPress = "reboot"; };
|
||||
logind = {
|
||||
killUserProcesses = true;
|
||||
powerKeyLongPress = "reboot";
|
||||
};
|
||||
};
|
||||
networking = {
|
||||
stevenBlackHosts = {
|
||||
enable = true;
|
||||
blockFakenews = true;
|
||||
blockGambling = true;
|
||||
};
|
||||
};
|
||||
networking = { stevenBlackHosts = { enable = true; blockFakenews = true; blockGambling = true; blockSocial = true; }; };
|
||||
});
|
||||
shell = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
|
||||
shell = moduleWithSystem (_: { pkgs, ... }: {
|
||||
programs = {
|
||||
starship.enable = true;
|
||||
zsh = {
|
||||
@ -60,11 +82,17 @@ top@{ inputs, moduleWithSystem, ... }: {
|
||||
};
|
||||
};
|
||||
});
|
||||
sound = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
|
||||
services = { pipewire = { enable = true; alsa.enable = true; pulse.enable = true; }; };
|
||||
sound = moduleWithSystem (_: { pkgs, ... }: {
|
||||
services = {
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
environment.systemPackages = with pkgs; [ pwvucontrol ];
|
||||
});
|
||||
music = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
|
||||
music = moduleWithSystem (_: { pkgs, ... }: {
|
||||
imports = [ inputs.musnix.nixosModules.musnix ];
|
||||
environment.systemPackages = with pkgs; [ guitarix ];
|
||||
services.pipewire = {
|
||||
@ -75,28 +103,52 @@ top@{ inputs, moduleWithSystem, ... }: {
|
||||
enable = true;
|
||||
rtcqs.enable = true;
|
||||
soundcardPciId = "00:1f.3";
|
||||
kernel = { realtime = true; packages = pkgs.linuxPackages-rt; };
|
||||
kernel = {
|
||||
realtime = true;
|
||||
packages = pkgs.linuxPackages-rt;
|
||||
};
|
||||
};
|
||||
});
|
||||
wayland = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: {
|
||||
wayland = moduleWithSystem (_: _: {
|
||||
hardware.graphics.enable = true;
|
||||
security.pam.services.swaylock = { };
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
wlr = { enable = true; settings = { screencast = { output_name = "HDMI-A-1"; max_fps = 60; }; }; };
|
||||
wlr = {
|
||||
enable = true;
|
||||
settings = {
|
||||
screencast = {
|
||||
output_name = "HDMI-A-1";
|
||||
max_fps = 60;
|
||||
};
|
||||
};
|
||||
};
|
||||
config.common.default = "*";
|
||||
};
|
||||
});
|
||||
security = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: {
|
||||
security = moduleWithSystem (_: _: {
|
||||
security = {
|
||||
sudo = { enable = false; execWheelOnly = true; extraRules = [{ groups = [ "wheel" ]; }]; };
|
||||
doas = { enable = true; extraRules = [{ groups = [ "wheel" ]; noPass = true; keepEnv = true; }]; };
|
||||
sudo = {
|
||||
enable = false;
|
||||
execWheelOnly = true;
|
||||
extraRules = [{ groups = [ "wheel" ]; }];
|
||||
};
|
||||
doas = {
|
||||
enable = true;
|
||||
extraRules = [
|
||||
{
|
||||
groups = [ "wheel" ];
|
||||
noPass = true;
|
||||
keepEnv = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
polkit.enable = true;
|
||||
rtkit.enable = true;
|
||||
};
|
||||
});
|
||||
wireguard = {
|
||||
intranet = {
|
||||
networking.wg-quick.interfaces = {
|
||||
wg0 = {
|
||||
address = [ "10.0.0.2/32" ];
|
||||
@ -111,6 +163,12 @@ top@{ inputs, moduleWithSystem, ... }: {
|
||||
];
|
||||
};
|
||||
};
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = "prohibit-password";
|
||||
};
|
||||
};
|
||||
};
|
||||
wireless = {
|
||||
networking = {
|
||||
@ -150,6 +208,19 @@ top@{ inputs, moduleWithSystem, ... }: {
|
||||
"KOTEKLAN_GUEST" = {
|
||||
psk = "koteklankotek";
|
||||
};
|
||||
"TP-Link_BE7A" = {
|
||||
psk = "84665461";
|
||||
};
|
||||
"Post120" = {
|
||||
psk = "9996663333";
|
||||
};
|
||||
"MOONLIGHT2019" = {
|
||||
psk = "seacrets";
|
||||
};
|
||||
"Kaiser Terrasse" = {
|
||||
psk = "Internet12";
|
||||
};
|
||||
"ATHENS-HAWKS" = { };
|
||||
"3G" = {
|
||||
hidden = true;
|
||||
};
|
||||
@ -157,8 +228,11 @@ top@{ inputs, moduleWithSystem, ... }: {
|
||||
};
|
||||
};
|
||||
};
|
||||
ivand = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }:
|
||||
let homeMods = top.config.flake.homeManagerModules; in {
|
||||
ivand = moduleWithSystem (_: { pkgs, ... }:
|
||||
let
|
||||
homeMods = top.config.flake.homeManagerModules;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.home-manager.nixosModules.default ];
|
||||
home-manager = {
|
||||
backupFileExtension = "bak";
|
||||
@ -197,25 +271,41 @@ top@{ inputs, moduleWithSystem, ... }: {
|
||||
];
|
||||
};
|
||||
};
|
||||
extraGroups = { mlocate = { }; realtime = { }; };
|
||||
extraGroups = {
|
||||
mlocate = { };
|
||||
realtime = { };
|
||||
};
|
||||
};
|
||||
programs.dconf.enable = true;
|
||||
});
|
||||
flatpak = {
|
||||
xdg = { portal = { enable = true; wlr.enable = true; config.common.default = "*"; }; };
|
||||
xdg = {
|
||||
portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
config.common.default = "*";
|
||||
};
|
||||
};
|
||||
services.flatpak.enable = true;
|
||||
};
|
||||
ai = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: {
|
||||
ai = moduleWithSystem (_: _: {
|
||||
services = { ollama.enable = true; };
|
||||
});
|
||||
anon = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
|
||||
containers = moduleWithSystem (_: _: {
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
storageDriver = "btrfs";
|
||||
};
|
||||
users.users.ivand.extraGroups = [ "docker" ];
|
||||
});
|
||||
anon = moduleWithSystem (_: { pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [ tor-browser ];
|
||||
});
|
||||
cryptocurrency = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: {
|
||||
cryptocurrency = moduleWithSystem (_: { pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [ monero-cli ];
|
||||
services = { monero.enable = true; };
|
||||
});
|
||||
monero-miner = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: {
|
||||
monero-miner = moduleWithSystem (_: _: {
|
||||
services = {
|
||||
xmrig = {
|
||||
enable = true;
|
||||
@ -236,12 +326,333 @@ top@{ inputs, moduleWithSystem, ... }: {
|
||||
};
|
||||
};
|
||||
});
|
||||
vps = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: {
|
||||
vps = moduleWithSystem (_: { ... }: {
|
||||
imports = [
|
||||
inputs.vpsadminos.nixosConfigurations.container
|
||||
inputs.simple-nixos-mailserver.nixosModule
|
||||
../../hosts/vps/mailserver
|
||||
];
|
||||
});
|
||||
mailserver = moduleWithSystem (_: { config
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
inputs.simple-nixos-mailserver.nixosModule
|
||||
];
|
||||
mailserver = {
|
||||
enable = true;
|
||||
localDnsResolver = false;
|
||||
fqdn = "mail.idimitrov.dev";
|
||||
domains = [ "idimitrov.dev" "mail.idimitrov.dev" ];
|
||||
loginAccounts = {
|
||||
"ivan@idimitrov.dev" = {
|
||||
hashedPassword = "$2b$05$rTVIQD98ogXeCBKdk/YufulWHqpMCAlb7SHDPlh5y8Xbukoa/uQLm";
|
||||
aliases = [ "admin@idimitrov.dev" ];
|
||||
};
|
||||
"security@idimitrov.dev" = {
|
||||
hashedPassword = "$2b$05$rTVIQD98ogXeCBKdk/YufulWHqpMCAlb7SHDPlh5y8Xbukoa/uQLm";
|
||||
};
|
||||
};
|
||||
certificateScheme = "acme-nginx";
|
||||
hierarchySeparator = "/";
|
||||
};
|
||||
services = {
|
||||
dovecot2.sieve.extensions = [ "fileinto" ];
|
||||
roundcube = {
|
||||
enable = true;
|
||||
package = pkgs.roundcube.withPlugins (plugins: [ plugins.persistent_login ]);
|
||||
plugins = [
|
||||
"persistent_login"
|
||||
];
|
||||
hostName = "${config.mailserver.fqdn}";
|
||||
extraConfig = ''
|
||||
$config['smtp_host'] = "tls://${config.mailserver.fqdn}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
};
|
||||
nginx.virtualHosts =
|
||||
let
|
||||
restrictToVpn = ''
|
||||
allow 10.0.0.2/32;
|
||||
allow 10.0.0.3/32;
|
||||
allow 10.0.0.4/32;
|
||||
deny all;
|
||||
'';
|
||||
in
|
||||
{
|
||||
"${config.mailserver.fqdn}" = {
|
||||
extraConfig = restrictToVpn;
|
||||
};
|
||||
};
|
||||
postgresql.enable = true;
|
||||
};
|
||||
security = {
|
||||
acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "security@idimitrov.dev";
|
||||
};
|
||||
};
|
||||
});
|
||||
nginx = moduleWithSystem (_: { pkgs, ... }: {
|
||||
services = {
|
||||
nginx =
|
||||
let
|
||||
webshiteConfig = ''
|
||||
add_header 'Referrer-Policy' 'origin-when-cross-origin';
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
'';
|
||||
extensions = [ "html" "txt" "png" "jpg" "jpeg" ];
|
||||
serveStatic = exts: ''
|
||||
try_files $uri $uri/ ${pkgs.lib.strings.concatStringsSep " " (builtins.map (x: "$uri." + "${x}") exts)} =404;
|
||||
'';
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
|
||||
virtualHosts = {
|
||||
"idimitrov.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
root = "${pkgs.webshite}";
|
||||
extraConfig = serveStatic extensions;
|
||||
};
|
||||
extraConfig = webshiteConfig;
|
||||
};
|
||||
"www.idimitrov.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
root = "${pkgs.webshite}";
|
||||
extraConfig = serveStatic extensions;
|
||||
};
|
||||
extraConfig = webshiteConfig;
|
||||
};
|
||||
"src.idimitrov.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:3001";
|
||||
};
|
||||
};
|
||||
"pic.idimitrov.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
root = "/var/pic";
|
||||
extraConfig = ''
|
||||
autoindex on;
|
||||
${serveStatic ["png"]}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
gitea = {
|
||||
enable = true;
|
||||
appName = "src";
|
||||
database = {
|
||||
type = "postgres";
|
||||
};
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "src.idimitrov.dev";
|
||||
ROOT_URL = "https://src.idimitrov.dev/";
|
||||
HTTP_PORT = 3001;
|
||||
};
|
||||
repository = {
|
||||
DEFAULT_BRANCH = "master";
|
||||
};
|
||||
service = {
|
||||
DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
postgresql = {
|
||||
enable = true;
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "root";
|
||||
ensureClauses = {
|
||||
superuser = true;
|
||||
createrole = true;
|
||||
createdb = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
});
|
||||
wireguard-output = moduleWithSystem (_: { pkgs, ... }: {
|
||||
networking = {
|
||||
nat = {
|
||||
enable = true;
|
||||
enableIPv6 = true;
|
||||
externalInterface = "venet0";
|
||||
internalInterfaces = [ "wg0" ];
|
||||
};
|
||||
wg-quick.interfaces = {
|
||||
wg0 =
|
||||
let
|
||||
iptables = "${pkgs.iptables}/bin/iptables";
|
||||
ip6tables = "${pkgs.iptables}/bin/ip6tables";
|
||||
in
|
||||
{
|
||||
address = [ "10.0.0.1/32" ];
|
||||
listenPort = 51820;
|
||||
privateKeyFile = "/etc/wireguard/privatekey";
|
||||
postUp = ''
|
||||
${iptables} -A FORWARD -i wg0 -j ACCEPT
|
||||
${iptables} -t nat -A POSTROUTING -s 10.0.0.1/24 -o venet0 -j MASQUERADE
|
||||
${ip6tables} -A FORWARD -i wg0 -j ACCEPT
|
||||
${ip6tables} -t nat -A POSTROUTING -s fdc9:281f:04d7:9ee9::1/64 -o venet0 -j MASQUERADE
|
||||
'';
|
||||
preDown = ''
|
||||
${iptables} -D FORWARD -i wg0 -j ACCEPT
|
||||
${iptables} -t nat -D POSTROUTING -s 10.0.0.1/24 -o venet0 -j MASQUERADE
|
||||
${ip6tables} -D FORWARD -i wg0 -j ACCEPT
|
||||
${ip6tables} -t nat -D POSTROUTING -s fdc9:281f:04d7:9ee9::1/64 -o venet0 -j MASQUERADE
|
||||
'';
|
||||
peers = [
|
||||
{
|
||||
publicKey = "kI93V0dVKSqX8hxMJHK5C0c1hEDPQTgPQDU8TKocVgo=";
|
||||
allowedIPs = [ "10.0.0.2/32" ];
|
||||
}
|
||||
{
|
||||
publicKey = "RqTsFxFCcgYsytcDr+jfEoOA5UNxa1ZzGlpx6iuTpXY=";
|
||||
allowedIPs = [ "10.0.0.3/32" ];
|
||||
}
|
||||
{
|
||||
publicKey = "1e0mjluqXdLbzv681HlC9B8BfGN8sIXIw3huLyQqwXI=";
|
||||
allowedIPs = [ "10.0.0.4/32" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
anonymous-dns = moduleWithSystem (_: _: {
|
||||
networking = {
|
||||
nameservers = [ "127.0.0.1" "::1" ];
|
||||
dhcpcd.extraConfig = "nohook resolv.conf";
|
||||
};
|
||||
services = {
|
||||
dnscrypt-proxy2 = {
|
||||
enable = true;
|
||||
settings = {
|
||||
cache = false;
|
||||
ipv4_servers = true;
|
||||
ipv6_servers = true;
|
||||
dnscrypt_servers = true;
|
||||
doh_servers = false;
|
||||
odoh_servers = false;
|
||||
require_dnssec = true;
|
||||
require_nolog = true;
|
||||
require_nofilter = true;
|
||||
anonymized_dns = {
|
||||
routes = [
|
||||
{
|
||||
server_name = "*";
|
||||
via = [ "sdns://gQ8yMTcuMTM4LjIyMC4yNDM" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
sources.public-resolvers = {
|
||||
urls = [
|
||||
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
||||
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
|
||||
];
|
||||
cache_file = "/var/lib/dnscrypt-proxy/public-resolvers.md";
|
||||
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
firewall = moduleWithSystem (_: { lib, ... }: {
|
||||
networking = {
|
||||
firewall = lib.mkForce {
|
||||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
25 # smtp
|
||||
465 # smtps
|
||||
80 # http
|
||||
443 # https
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
25
|
||||
465
|
||||
80
|
||||
443
|
||||
51820 # wireguard
|
||||
];
|
||||
extraCommands = ''
|
||||
iptables -N vpn # create a new chain named vpn
|
||||
iptables -A vpn --src 10.0.0.2 -j ACCEPT # allow
|
||||
iptables -A vpn --src 10.0.0.3 -j ACCEPT # allow
|
||||
iptables -A vpn --src 10.0.0.4 -j ACCEPT # allow
|
||||
iptables -A vpn -j DROP # drop everyone else
|
||||
iptables -I INPUT -m tcp -p tcp --dport 22 -j vpn
|
||||
'';
|
||||
extraStopCommands = ''
|
||||
iptables -F vpn
|
||||
iptables -D INPUT -m tcp -p tcp --dport 22 -j vpn
|
||||
iptables -X vpn
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
rest = moduleWithSystem (_: { pkgs, ... }: {
|
||||
fileSystems."/mnt/export1981" = {
|
||||
device = "172.16.128.47:/nas/5490";
|
||||
fsType = "nfs";
|
||||
options = [ "nofail" ];
|
||||
};
|
||||
users = {
|
||||
users.ivand = {
|
||||
isNormalUser = true;
|
||||
hashedPassword = "$2b$05$hPrPcewxj4qjLCRQpKBAu.FKvKZdIVlnyn4uYsWE8lc21Jhvc9jWG";
|
||||
extraGroups = [ "wheel" "adm" "mlocate" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
''
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICcLkzuCoBEg+wq/H+hkrv6pLJ8J5BejaNJVNnymlnlo ivan@idimitrov.dev
|
||||
''
|
||||
];
|
||||
};
|
||||
extraGroups = { mlocate = { }; };
|
||||
};
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = "prohibit-password";
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd = {
|
||||
timers = {
|
||||
bingwp = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 10:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
services = {
|
||||
bingwp = {
|
||||
description = "Download bing image of the day";
|
||||
script = ''
|
||||
${pkgs.nushell}/bin/nu -c "http get ('https://bing.com' + ((http get https://www.bing.com/HPImageArchive.aspx?format=js&n=1).images.0.url)) | save ('/var/pic' | path join ( [ (date now | format date '%Y-%m-%d'), '.png' ] | str join ))"
|
||||
${pkgs.nushell}/bin/nu -c "${pkgs.toybox}/bin/ln -sf (ls /var/pic | where type == file | get name | sort | last) /var/pic/latest.png"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -1,14 +1,8 @@
|
||||
top@{ inputs, withSystem, ... }: {
|
||||
flake.overlays.default = final: prev:
|
||||
let system = "x86_64-linux"; in withSystem system (
|
||||
{ config, ... }: {
|
||||
nvim = config.packages.nvim;
|
||||
bingwp = config.packages.bingwp;
|
||||
screenshot = config.packages.screenshot;
|
||||
cursors = config.packages.cursors;
|
||||
wpd = config.packages.wpd;
|
||||
webshite = config.packages.webshite;
|
||||
sal = inputs.sal.packages.${system}.default;
|
||||
{ withSystem, ... }: {
|
||||
flake.overlays.default = _: _:
|
||||
withSystem "x86_64-linux" (
|
||||
{ config, ... }: with config.packages; {
|
||||
inherit nvim bingwp screenshot cursors wpd webshite sal;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -1,67 +1,69 @@
|
||||
top@{ inputs, ... }: {
|
||||
perSystem = perSystem@{ system, pkgs, ... }: {
|
||||
config.packages = {
|
||||
nvim = inputs.ide.nvim.${system}.standalone.default {
|
||||
plugins.lsp.servers = {
|
||||
bashls.enable = true;
|
||||
pylsp.enable = true;
|
||||
lua-ls.enable = true;
|
||||
{ inputs, ... }: {
|
||||
perSystem =
|
||||
{ system, pkgs, ... }: {
|
||||
config.packages = {
|
||||
nvim = inputs.ide.nvim.${system}.standalone.default {
|
||||
plugins.lsp.servers = {
|
||||
bashls.enable = true;
|
||||
pylsp.enable = true;
|
||||
lua-ls.enable = true;
|
||||
};
|
||||
extraPlugins = with pkgs.vimPlugins; [ vim-just ];
|
||||
};
|
||||
extraPlugins = with pkgs.vimPlugins; [ vim-just ];
|
||||
};
|
||||
wpd = pkgs.writeShellApplication {
|
||||
name = "wpd";
|
||||
runtimeInputs = with pkgs; [ swaybg xdg-user-dirs fd uutils-coreutils-noprefix ];
|
||||
runtimeEnv = { WAYLAND_DISPLAY = "wayland-1"; };
|
||||
text = ''
|
||||
random_pic () {
|
||||
bg_dir="$(xdg-user-dir PICTURES)/bg"
|
||||
fd . --extension png "$bg_dir" | shuf -n1
|
||||
}
|
||||
swaybg -i "$(random_pic)" -m fill &
|
||||
OLD_PID=$!
|
||||
while true; do
|
||||
sleep 60
|
||||
swaybg -i "$(random_pic)" -m fill &
|
||||
NEXT_PID=$!
|
||||
sleep 5
|
||||
kill -9 $OLD_PID
|
||||
OLD_PID=$NEXT_PID
|
||||
done
|
||||
'';
|
||||
};
|
||||
screenshot = pkgs.writeShellApplication {
|
||||
name = "screenshot";
|
||||
runtimeInputs = with pkgs; [ wl-clipboard xdg-utils ];
|
||||
text = ''
|
||||
ss_dir="$(xdg-user-dir PICTURES)/ss"
|
||||
pic_dir="$ss_dir/$(date "+%Y-%m-%d_%H-%M-%S").png"
|
||||
|
||||
mkdir -p "$ss_dir"
|
||||
|
||||
copy_image () {
|
||||
wl-copy < "$pic_dir"
|
||||
}
|
||||
|
||||
main () {
|
||||
grim "$pic_dir"
|
||||
copy_image
|
||||
}
|
||||
|
||||
main
|
||||
'';
|
||||
};
|
||||
cursors = pkgs.catppuccin-cursors.overrideAttrs (prev: rec {
|
||||
version = "0.3.1";
|
||||
nativeBuildInputs = prev.nativeBuildInputs ++ [ pkgs.xcur2png ];
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "catppuccin";
|
||||
repo = "cursors";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-CuzD6O/RImFKLWzJoiUv7nlIdoXNvwwl+k5mTeVIY10=";
|
||||
wpd = pkgs.writeShellApplication {
|
||||
name = "wpd";
|
||||
runtimeInputs = with pkgs; [ swaybg xdg-user-dirs fd uutils-coreutils-noprefix ];
|
||||
runtimeEnv = { WAYLAND_DISPLAY = "wayland-1"; };
|
||||
text = ''
|
||||
random_pic () {
|
||||
bg_dir="$(xdg-user-dir PICTURES)/bg"
|
||||
fd . --extension png "$bg_dir" | shuf -n1
|
||||
}
|
||||
swaybg -i "$(random_pic)" -m fill &
|
||||
OLD_PID=$!
|
||||
while true; do
|
||||
sleep 60
|
||||
swaybg -i "$(random_pic)" -m fill &
|
||||
NEXT_PID=$!
|
||||
sleep 5
|
||||
kill -9 $OLD_PID
|
||||
OLD_PID=$NEXT_PID
|
||||
done
|
||||
'';
|
||||
};
|
||||
});
|
||||
webshite = inputs.webshite.packages.${system}.default;
|
||||
screenshot = pkgs.writeShellApplication {
|
||||
name = "screenshot";
|
||||
runtimeInputs = with pkgs; [ wl-clipboard xdg-utils ];
|
||||
text = ''
|
||||
ss_dir="$(xdg-user-dir PICTURES)/ss"
|
||||
pic_dir="$ss_dir/$(date "+%Y-%m-%d_%H-%M-%S").png"
|
||||
|
||||
mkdir -p "$ss_dir"
|
||||
|
||||
copy_image () {
|
||||
wl-copy < "$pic_dir"
|
||||
}
|
||||
|
||||
main () {
|
||||
grim "$pic_dir"
|
||||
copy_image
|
||||
}
|
||||
|
||||
main
|
||||
'';
|
||||
};
|
||||
cursors = pkgs.catppuccin-cursors.overrideAttrs (prev: rec {
|
||||
version = "0.3.1";
|
||||
nativeBuildInputs = prev.nativeBuildInputs ++ [ pkgs.xcur2png ];
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "catppuccin";
|
||||
repo = "cursors";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-CuzD6O/RImFKLWzJoiUv7nlIdoXNvwwl+k5mTeVIY10=";
|
||||
};
|
||||
});
|
||||
webshite = inputs.webshite.packages.${system}.default;
|
||||
sal = inputs.sal.packages."x86_64-linux".default;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user