Compare commits
185 Commits
feat_parts
...
master
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 | |||
76266ac03e | |||
0bf31f6699 | |||
2d99617d89 | |||
12466783f7 | |||
0bd094330d | |||
13ca2bc6c5 | |||
d94928d1cf | |||
bac787e1d7 | |||
b7a673f537 | |||
89c45a9e8f | |||
764bf2d3e7 | |||
ea537f647e | |||
e2e10b3f0a | |||
b432efdd0f | |||
ae75c299cb | |||
b99de1d61f | |||
3a301ddce5 | |||
1d438b291d | |||
6ea6fbaa9c | |||
6631b11382 | |||
e3eb263108 | |||
ab4d05ae3c | |||
76f954a335 | |||
69b444e3e7 | |||
aec13e232b | |||
579259b156 | |||
fa2081dab1 | |||
c09e7674f4 | |||
cc7382ac20 | |||
c6000ae94f | |||
09f0ab478d | |||
1b2bbc3a31 | |||
e1a429bdec | |||
7e03c3f3f1 | |||
8f57211bf5 | |||
09c083c5e4 | |||
91acd7e216 | |||
09dbf066f8 | |||
98fec7c447 | |||
38b4664e6f | |||
f05e8968d8 | |||
32a46bf0c7 | |||
be21318ed1 | |||
5cb70e464a | |||
3ad76bcd69 | |||
e3da8e7072 | |||
a1d0ca2d65 | |||
588190e7b6 | |||
776e4cd49c | |||
0f4d3087f6 | |||
096d73470d | |||
a32a8e3777 | |||
59b83495fc | |||
60538957a4 | |||
243c6232d6 | |||
c5ee685ed8 | |||
bae652bf97 | |||
9ec183549d | |||
7127c71d1c | |||
7872a7b3a7 | |||
6efeb73394 | |||
9ed0dbb95c | |||
108604c457 | |||
fe7a23ecbc | |||
f228bc6962 | |||
96fa7ddfb1 | |||
fccce59c0d | |||
b6b7835cc9 | |||
1168e46fb6 | |||
50d8c40057 | |||
ae2d09475f | |||
e50c532a6d | |||
c8ce02fe2d | |||
754c20868d | |||
1d0aeced87 | |||
62397ced8d | |||
55533888e9 | |||
51edd5bbb7 | |||
095e7531cb | |||
84169072de | |||
ce8b986fd2 | |||
21e17fefa2 | |||
e6313d810d | |||
e521af0b12 | |||
9f44008493 | |||
82c4bfe778 | |||
6a4d3f96e7 | |||
b1ee621d91 | |||
e79c4a0081 | |||
a66f628805 | |||
99afb06b2f | |||
696c3b0e3c | |||
0fdd976815 | |||
1ffb9d6db5 | |||
6d0aefdc94 | |||
c6d1daba13 | |||
9286ff5044 | |||
a1ed6a69fa | |||
ffceb60bb8 | |||
876a3f631e | |||
0178ba7e33 | |||
16444f4ea9 | |||
3349451235 | |||
ca57494834 | |||
9d672f7832 | |||
853ffca7cc | |||
ac766f8b01 | |||
d2b68866d0 | |||
01ff1fff57 | |||
37f0d1df20 | |||
a29de4f7ca | |||
c3887fdf8b | |||
335c20346c | |||
33437e8eab | |||
85575729e2 | |||
41692c2972 | |||
3f8562de4e | |||
e7bc95e70a | |||
338fd6e92c | |||
d1a08295ed | |||
4de15ebaf9 | |||
068bbcff91 | |||
ab7b22ed42 | |||
88097232f5 | |||
2818571227 | |||
6240ba037b | |||
85a9847dd1 | |||
cb47c35df5 | |||
c4ffe7c0cb | |||
21fde799cc | |||
163f5f4b6f | |||
985381b85e | |||
3f75b0e6fc | |||
5d16639bc0 | |||
2d11578fc1 | |||
73aad6b0ef | |||
2248957262 | |||
73812dc664 | |||
78060c275a | |||
97389b3f4b | |||
19f7f639ba | |||
d785e53032 | |||
3ba9fc0122 | |||
1687400059 | |||
c8c3601ddc | |||
ec3d854704 | |||
c12df3f09e | |||
3285c43a90 | |||
ee9dedde88 | |||
7d2cf634c2 | |||
59d34c8182 | |||
f047cc42e5 | |||
9e519e6c22 | |||
9d9640ac16 | |||
4a7b27602d |
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
|||||||
|
result
|
24
Justfile
Normal file
24
Justfile
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
default: nova
|
||||||
|
|
||||||
|
all: nova (nova "music")
|
||||||
|
|
||||||
|
nova config="nova":
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
cfg={{config}}
|
||||||
|
if [ "$cfg" != "nova" ]; then
|
||||||
|
cfg="nova-{{config}}"
|
||||||
|
fi
|
||||||
|
doas nixos-rebuild switch --flake ./#"$cfg"
|
||||||
|
|
||||||
|
update:
|
||||||
|
nix flake update
|
||||||
|
|
||||||
|
clean:
|
||||||
|
nix-collect-garbage --delete-older-than 90d
|
||||||
|
doas nix-collect-garbage --delete-older-than 90d
|
||||||
|
|
||||||
|
generate format="install-iso" config="install-iso":
|
||||||
|
nix shell nixpkgs#nixos-generators --command nixos-generate -f {{format}} --flake ./#{{config}}
|
||||||
|
|
||||||
|
vps:
|
||||||
|
nixos-rebuild switch --flake ./#vps --target-host root@37.205.13.29
|
53
README.md
53
README.md
@ -1,39 +1,26 @@
|
|||||||
# My personal nixos config.
|
# NixOS configurations
|
||||||
|
|
||||||
### Usage
|
This repository aims to configure everything I use for all my machines.
|
||||||
|
|
||||||
To build the base system for my craptop:
|
### Goals
|
||||||
|
|
||||||
|
- Provide me with something that I personally can use.
|
||||||
|
- Make it modular so that it can be reused by other people or me on other people's machines (my company's workstation).
|
||||||
|
|
||||||
|
### How to use
|
||||||
|
|
||||||
|
[Check the home-manager modules](./home/modules/default.nix)
|
||||||
|
|
||||||
|
[Check the NixOS modules](./nixos/modules/default.nix)
|
||||||
|
|
||||||
|
These are exposed in the following way
|
||||||
|
|
||||||
|
`<this-flake>.homeManagerModules.<module>`
|
||||||
|
|
||||||
|
`<this-flake>.nixosModules.<module>`
|
||||||
|
|
||||||
|
Run the following for more info:
|
||||||
```bash
|
```bash
|
||||||
sudo nixos-rebuild switch --flake github:ivandimitrov8080/configuration.nix#laptop
|
nix flake show github:ivandimitrov8080/configuration.nix
|
||||||
```
|
|
||||||
|
|
||||||
To build ivand home:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
home-manager switch --flake github:ivandimitrov8080/configuration.nix#ivand
|
|
||||||
```
|
|
||||||
|
|
||||||
To reuse modules:
|
|
||||||
|
|
||||||
in your flake.nix:
|
|
||||||
```nix
|
|
||||||
inputs.ivan-mods = {
|
|
||||||
url = "github:ivandimitrov8080/configuration.nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
outputs = {self, nixpkgs, ivan-mods, ...}:{
|
|
||||||
...
|
|
||||||
homeConfigurations = {
|
|
||||||
my-user = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = with ivan-mods.modules.home; [
|
|
||||||
programs.nvim
|
|
||||||
programs.zsh
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
...
|
|
||||||
};
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
35
bin/bingwp
35
bin/bingwp
@ -1,35 +0,0 @@
|
|||||||
#!/usr/bin/env nu
|
|
||||||
|
|
||||||
let today = (date now | format date '%Y-%m-%d')
|
|
||||||
let pic_dir = (xdg-user-dir PICTURES)
|
|
||||||
let bg_dir = $pic_dir | path join "bg"
|
|
||||||
let today_img_file = $bg_dir | path join ( [ $today, ".png" ] | str join )
|
|
||||||
let is_new = ((date now | format date "%H" | into int) >= 10)
|
|
||||||
mkdir $bg_dir
|
|
||||||
|
|
||||||
def exists [file: path] {
|
|
||||||
return ($file | path exists)
|
|
||||||
}
|
|
||||||
|
|
||||||
def is_empty [file: path] {
|
|
||||||
return ((exists $file) and ((ls $file | get size | first | into int) == 0))
|
|
||||||
}
|
|
||||||
|
|
||||||
def fetch [] {
|
|
||||||
http get ("https://bing.com" + ((http get https://www.bing.com/HPImageArchive.aspx?format=js&n=1).images.0.url)) | save $today_img_file
|
|
||||||
}
|
|
||||||
|
|
||||||
def cleanup [] {
|
|
||||||
if (is_empty $today_img_file) {
|
|
||||||
rm -rf $today_img_file
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup
|
|
||||||
|
|
||||||
if $is_new and (not (exists $today_img_file)) {
|
|
||||||
fetch
|
|
||||||
/run/current-system/sw/bin/ln -sf $today_img_file ( $pic_dir | path join "bg.png" )
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup
|
|
22
bin/ks
22
bin/ks
@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
doc_dir=$(xdg-user-dir DOCUMENTS)
|
|
||||||
ks_dir="$doc_dir/ks"
|
|
||||||
name="$1"
|
|
||||||
full_path="$ks_dir/$name.md.gpg"
|
|
||||||
tmpfile="/tmp/$name.md"
|
|
||||||
|
|
||||||
mkdir -p "$ks_dir"
|
|
||||||
cd "$ks_dir"
|
|
||||||
|
|
||||||
if [ -f "$full_path" ]; then
|
|
||||||
gpg --decrypt -o "$tmpfile" "$full_path"
|
|
||||||
else
|
|
||||||
touch "$tmpfile"
|
|
||||||
fi
|
|
||||||
|
|
||||||
$EDITOR "$tmpfile"
|
|
||||||
|
|
||||||
gpg --encrypt -r ivan@idimitrov.dev -o "$full_path" "$tmpfile"
|
|
||||||
|
|
||||||
git add . && git commit -m "editing $name" && git push --set-upstream origin HEAD
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cd "$HOME"
|
|
||||||
|
|
||||||
rm -rf .visualvm .bin .npm .cache .cargo .librewolf .mupdf.history .ollama .psql_history .python_history .sbt .tldrc .zcompdump .viminfo .wireguard
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/usr/bin/env nu
|
|
||||||
|
|
||||||
let tmp_img = "/tmp/screen.png" | path join
|
|
||||||
let ss_dir = ((xdg-user-dir PICTURES | str trim) | path join "ss")
|
|
||||||
let pic_dir = ($ss_dir | path join ((date now | format date) | str join ".png"))
|
|
||||||
|
|
||||||
mkdir $ss_dir
|
|
||||||
|
|
||||||
def copy_image [] {
|
|
||||||
open $pic_dir | wl-copy
|
|
||||||
}
|
|
||||||
|
|
||||||
def prepare_screen [] {
|
|
||||||
let grim_id = pueue add -i -p grim $tmp_img
|
|
||||||
let imv_id = pueue add -a $grim_id -p imv -f $tmp_img
|
|
||||||
grim -g $"(slurp -b '#FFFFFF00' -c '#FF0000FF')" $pic_dir
|
|
||||||
pueue kill $imv_id $grim_id
|
|
||||||
pueue wait
|
|
||||||
pueue remove $imv_id $grim_id
|
|
||||||
}
|
|
||||||
|
|
||||||
def "main area" [] {
|
|
||||||
prepare_screen
|
|
||||||
copy_image
|
|
||||||
}
|
|
||||||
|
|
||||||
def main [] {
|
|
||||||
grim $pic_dir
|
|
||||||
copy_image
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
ssh -n vpsfree-root 'cat /var/log/nginx/access.log' | goaccess --datetime-format='%d/%b/%Y:%H:%M:%S %z' --log-format='COMBINED'
|
|
15
default.nix
Normal file
15
default.nix
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
top @ { inputs, ... }: {
|
||||||
|
imports = [ ./nixos ./home ./packages ./overlays ./hardware-configurations ];
|
||||||
|
systems = [ "x86_64-linux" ];
|
||||||
|
flake.stateVersion = "24.05";
|
||||||
|
perSystem = { system, ... }: {
|
||||||
|
config._module.args = {
|
||||||
|
pkgs = import inputs.nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [
|
||||||
|
top.config.flake.overlays.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
890
flake.lock
890
flake.lock
File diff suppressed because it is too large
Load Diff
56
flake.nix
56
flake.nix
@ -1,10 +1,15 @@
|
|||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
vpsadminos.url = "github:vpsfreecz/vpsadminos";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-24.05";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
parts = {
|
||||||
|
url = "github:hercules-ci/flake-parts";
|
||||||
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
|
};
|
||||||
hosts = {
|
hosts = {
|
||||||
url = "github:StevenBlack/hosts";
|
url = "github:StevenBlack/hosts";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@ -13,40 +18,25 @@
|
|||||||
url = "github:ivandimitrov8080/flake-ide";
|
url = "github:ivandimitrov8080/flake-ide";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nid = {
|
sal = {
|
||||||
url = "github:nix-community/nix-index-database";
|
url = "github:ivandimitrov8080/sal";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
ide.follows = "ide";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
musnix = {
|
||||||
|
url = "github:musnix/musnix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
catppuccin.url = "github:catppuccin/nix";
|
simple-nixos-mailserver = {
|
||||||
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
outputs = { nixpkgs, home-manager, hosts, ide, nid, catppuccin, ... }:
|
webshite = {
|
||||||
let
|
url = "github:ivandimitrov8080/idimitrov.dev";
|
||||||
system = "x86_64-linux";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
stateVersion = "24.05";
|
|
||||||
my-overlay = self: super: {
|
|
||||||
scripts = (super.buildEnv { name = "scripts"; paths = [ ./. ]; });
|
|
||||||
};
|
};
|
||||||
pkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = [ my-overlay ];
|
|
||||||
};
|
|
||||||
modules = import ./modules {
|
|
||||||
inherit system nixpkgs pkgs ide my-overlay;
|
|
||||||
};
|
|
||||||
home = import ./home {
|
|
||||||
inherit stateVersion pkgs modules home-manager nid catppuccin;
|
|
||||||
};
|
|
||||||
nixos = import ./nixos {
|
|
||||||
inherit stateVersion system nixpkgs modules hosts catppuccin;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
nixosConfigurations = {
|
|
||||||
laptop = nixos.laptop;
|
|
||||||
};
|
|
||||||
homeConfigurations = {
|
|
||||||
ivand = home.ivand;
|
|
||||||
};
|
|
||||||
modules = modules;
|
|
||||||
};
|
};
|
||||||
|
outputs = inputs: inputs.parts.lib.mkFlake {inherit inputs;} {imports = [./.];};
|
||||||
}
|
}
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/sda1";
|
|
||||||
fsType = "btrfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/D76B-0BB3";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
30
hardware-configurations/default.nix
Normal file
30
hardware-configurations/default.nix
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
_: {
|
||||||
|
flake.hardwareConfigurations = {
|
||||||
|
nova = { lib, modulesPath, ... }: {
|
||||||
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
boot = {
|
||||||
|
initrd = {
|
||||||
|
availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||||
|
kernelModules = [ ];
|
||||||
|
luks.devices."nixos".device = "/dev/disk/by-uuid/712dd8ba-d5b4-438a-9a77-663b8c935cfe";
|
||||||
|
};
|
||||||
|
kernelModules = [ "kvm-intel" ];
|
||||||
|
extraModulePackages = [ ];
|
||||||
|
};
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
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;
|
||||||
|
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkForce false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,41 +1,3 @@
|
|||||||
{ stateVersion, pkgs, home-manager, modules, nid, catppuccin, ... }:
|
|
||||||
let
|
|
||||||
ivand-programs = with modules.home.programs; [
|
|
||||||
bat
|
|
||||||
bottom
|
|
||||||
browserpass
|
|
||||||
carapace
|
|
||||||
chromium
|
|
||||||
cliphist
|
|
||||||
comma
|
|
||||||
firefox
|
|
||||||
git
|
|
||||||
gpg
|
|
||||||
imv
|
|
||||||
kitty
|
|
||||||
lf
|
|
||||||
mako
|
|
||||||
mpv
|
|
||||||
nushell
|
|
||||||
nvim
|
|
||||||
obs-studio
|
|
||||||
pueue
|
|
||||||
rofi
|
|
||||||
starship
|
|
||||||
sway
|
|
||||||
swaylock
|
|
||||||
tealdeer
|
|
||||||
tmux
|
|
||||||
waybar
|
|
||||||
zsh
|
|
||||||
];
|
|
||||||
ivand-packages = {
|
|
||||||
home.packages = with modules.home.packages; (dev ++ essential ++ random);
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
ivand = home-manager.lib.homeManagerConfiguration {
|
imports = [./modules];
|
||||||
inherit pkgs;
|
|
||||||
modules = [{ home.stateVersion = stateVersion; } ./ivand nid.hmModules.nix-index ivand-packages] ++ ivand-programs ++ [ catppuccin.homeManagerModules.catppuccin ];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1,109 +0,0 @@
|
|||||||
{ pkgs, ... }: rec {
|
|
||||||
|
|
||||||
programs.home-manager = { enable = true; };
|
|
||||||
|
|
||||||
|
|
||||||
catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
flavor = "mocha";
|
|
||||||
};
|
|
||||||
|
|
||||||
gtk = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home = rec {
|
|
||||||
username = "ivand";
|
|
||||||
homeDirectory = "/home/ivand";
|
|
||||||
sessionPath = [
|
|
||||||
"$HOME/.local/bin"
|
|
||||||
];
|
|
||||||
sessionVariables = {
|
|
||||||
PASSWORD_STORE_DIR = "${homeDirectory}/.password-store";
|
|
||||||
EDITOR = "nvim";
|
|
||||||
PAGER = "bat";
|
|
||||||
TERM = "screen-256color";
|
|
||||||
};
|
|
||||||
pointerCursor = {
|
|
||||||
name = "Catppuccin-Mocha-Green-Cursors";
|
|
||||||
package = pkgs.catppuccin-cursors.mochaGreen;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user = {
|
|
||||||
timers = {
|
|
||||||
rbingwp = {
|
|
||||||
Timer = {
|
|
||||||
OnCalendar = "*-*-* 10:00:00";
|
|
||||||
Persistent = true;
|
|
||||||
};
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "timers.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services = {
|
|
||||||
wpd = {
|
|
||||||
Service = {
|
|
||||||
Environment = [
|
|
||||||
"PATH=${pkgs.xdg-user-dirs}/bin:${pkgs.swaybg}/bin"
|
|
||||||
];
|
|
||||||
ExecStart = [ "${pkgs.nushell}/bin/nu -c 'swaybg -i ((xdg-user-dir PICTURES) | path split | path join bg.png)'" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
bingwp = {
|
|
||||||
Service = {
|
|
||||||
Type = "oneshot";
|
|
||||||
Environment = [
|
|
||||||
"PATH=${pkgs.xdg-user-dirs}/bin:${pkgs.nushell}/bin"
|
|
||||||
];
|
|
||||||
ExecStart = [ "${pkgs.scripts}/bin/bingwp" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
rbingwp = {
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "sway-session.target" ];
|
|
||||||
};
|
|
||||||
Unit = {
|
|
||||||
Description = "Restart bingwp and wpd services";
|
|
||||||
After = "graphical-session-pre.target";
|
|
||||||
PartOf = "graphical-session.target";
|
|
||||||
};
|
|
||||||
Service = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = [ "${pkgs.nushell}/bin/nu -c '${pkgs.systemd}/bin/systemctl --user restart bingwp.service; ${pkgs.systemd}/bin/systemctl --user restart wpd.service'" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg = {
|
|
||||||
enable = true;
|
|
||||||
userDirs = {
|
|
||||||
enable = true;
|
|
||||||
createDirectories = true;
|
|
||||||
desktop = "${home.homeDirectory}/dt";
|
|
||||||
documents = "${home.homeDirectory}/doc";
|
|
||||||
download = "${home.homeDirectory}/dl";
|
|
||||||
pictures = "${home.homeDirectory}/pic";
|
|
||||||
videos = "${home.homeDirectory}/vid";
|
|
||||||
templates = "${home.homeDirectory}/tpl";
|
|
||||||
publicShare = "${home.homeDirectory}/pub";
|
|
||||||
music = "${home.homeDirectory}/mus";
|
|
||||||
};
|
|
||||||
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";
|
|
||||||
"x-scheme-handler/mailto" = "userapp-Thunderbird-LDALA2.desktop";
|
|
||||||
"message/rfc822" = "userapp-Thunderbird-LDALA2.desktop";
|
|
||||||
"x-scheme-handler/mid" = "userapp-Thunderbird-LDALA2.desktop";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
722
home/modules/default.nix
Normal file
722
home/modules/default.nix
Normal file
@ -0,0 +1,722 @@
|
|||||||
|
toplevel @ { moduleWithSystem, ... }: {
|
||||||
|
flake.homeManagerModules = {
|
||||||
|
base = moduleWithSystem (
|
||||||
|
_: { config, ... }: {
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
home.stateVersion = toplevel.config.flake.stateVersion;
|
||||||
|
xdg = {
|
||||||
|
enable = true;
|
||||||
|
userDirs = with config; {
|
||||||
|
enable = true;
|
||||||
|
createDirectories = true;
|
||||||
|
desktop = "${home.homeDirectory}/dt";
|
||||||
|
documents = "${home.homeDirectory}/doc";
|
||||||
|
download = "${home.homeDirectory}/dl";
|
||||||
|
pictures = "${home.homeDirectory}/pic";
|
||||||
|
videos = "${home.homeDirectory}/vid";
|
||||||
|
templates = "${home.homeDirectory}/tpl";
|
||||||
|
publicShare = "${home.homeDirectory}/pub";
|
||||||
|
music = "${home.homeDirectory}/mus";
|
||||||
|
};
|
||||||
|
mimeApps.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
ivand = moduleWithSystem (
|
||||||
|
_: { pkgs, ... }: {
|
||||||
|
home = {
|
||||||
|
username = "ivand";
|
||||||
|
homeDirectory = "/home/ivand";
|
||||||
|
sessionVariables = { EDITOR = "nvim"; };
|
||||||
|
packages = with pkgs; [ nvim ];
|
||||||
|
};
|
||||||
|
programs = {
|
||||||
|
git = with pkgs.lib; {
|
||||||
|
userName = mkForce "Ivan Kirilov Dimitrov";
|
||||||
|
userEmail = mkForce "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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
util = moduleWithSystem (
|
||||||
|
_: { pkgs
|
||||||
|
, config
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
home = {
|
||||||
|
packages = with pkgs; [ openssl mlocate uutils-coreutils-noprefix speedtest-cli ];
|
||||||
|
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"; };
|
||||||
|
};
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tealdeer = {
|
||||||
|
enable = 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;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
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=";
|
||||||
|
};
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ssh.enable = true;
|
||||||
|
gpg.enable = true;
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
gpg-agent = {
|
||||||
|
enable = true;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
pinentryPackage = pkgs.pinentry-qt;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
shell = moduleWithSystem (
|
||||||
|
_: { pkgs, ... }: {
|
||||||
|
programs =
|
||||||
|
let
|
||||||
|
shellAliases = {
|
||||||
|
cal = "cal $(date +%Y)";
|
||||||
|
GG = "git add . && git commit -m 'GG' && git push --set-upstream origin HEAD";
|
||||||
|
gad = "git add . && git diff --cached";
|
||||||
|
gac = "ga && gc";
|
||||||
|
ga = "git add .";
|
||||||
|
gc = "git commit";
|
||||||
|
dev = "nix develop --command $SHELL";
|
||||||
|
ls = "eza";
|
||||||
|
la = "eza --all";
|
||||||
|
lt = "eza --git-ignore --all --tree --level=10";
|
||||||
|
sc = "systemctl";
|
||||||
|
neofetch = "${pkgs.fastfetch}/bin/fastfetch -c all.jsonc";
|
||||||
|
};
|
||||||
|
sessionVariables = { };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
bash = {
|
||||||
|
inherit shellAliases sessionVariables;
|
||||||
|
enable = true;
|
||||||
|
enableVteIntegration = true;
|
||||||
|
historyControl = [ "erasedups" ];
|
||||||
|
historyIgnore = [ "ls" "cd" "exit" ];
|
||||||
|
};
|
||||||
|
zsh = {
|
||||||
|
inherit shellAliases sessionVariables;
|
||||||
|
enable = true;
|
||||||
|
dotDir = ".config/zsh";
|
||||||
|
defaultKeymap = "viins";
|
||||||
|
enableVteIntegration = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
autosuggestion.enable = true;
|
||||||
|
history.expireDuplicatesFirst = true;
|
||||||
|
historySubstringSearch.enable = true;
|
||||||
|
};
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
kitty.shellIntegration = {
|
||||||
|
enableBashIntegration = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
tmux = {
|
||||||
|
enable = true;
|
||||||
|
clock24 = true;
|
||||||
|
baseIndex = 1;
|
||||||
|
escapeTime = 0;
|
||||||
|
keyMode = "vi";
|
||||||
|
shell = "\${SHELL}";
|
||||||
|
terminal = "screen-256color";
|
||||||
|
plugins = with pkgs.tmuxPlugins; [ tilish catppuccin ];
|
||||||
|
extraConfig = ''
|
||||||
|
set-option -a terminal-features 'screen-256color:RGB'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
starship = {
|
||||||
|
enable = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
};
|
||||||
|
eza = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
extraOptions = [
|
||||||
|
"--long"
|
||||||
|
"--header"
|
||||||
|
"--icons"
|
||||||
|
"--smart-group"
|
||||||
|
"--mounts"
|
||||||
|
"--octal-permissions"
|
||||||
|
"--git"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
swayland = moduleWithSystem (
|
||||||
|
_: { pkgs
|
||||||
|
, config
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
home = {
|
||||||
|
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;
|
||||||
|
systemd.enable = true;
|
||||||
|
config = rec {
|
||||||
|
menu = "rofi -show run";
|
||||||
|
terminal = "kitty";
|
||||||
|
modifier = "Mod4";
|
||||||
|
startup = [
|
||||||
|
{ command = "swaymsg 'workspace 2; exec firefox'"; }
|
||||||
|
{ command = "swaymsg 'workspace 1; exec kitty'"; }
|
||||||
|
];
|
||||||
|
bars = [ ];
|
||||||
|
window.titlebar = false;
|
||||||
|
keybindings = pkgs.lib.mkOptionDefault {
|
||||||
|
"F1" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
"Shift+F1" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||||
|
"F2" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||||
|
"Shift+F2" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ -5%";
|
||||||
|
"F3" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||||
|
"Shift+F3" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ +5%";
|
||||||
|
"F9" = "exec doas ${pkgs.light}/bin/light -A 10";
|
||||||
|
"F8" = "exec doas ${pkgs.light}/bin/light -U 10";
|
||||||
|
"Alt+Shift+l" = "exec ${pkgs.swaylock}/bin/swaylock";
|
||||||
|
"${modifier}+p" = "exec ${menu}";
|
||||||
|
"${modifier}+Shift+s" = "exec ${pkgs.screenshot}/bin/screenshot";
|
||||||
|
"${modifier}+c" = "exec ${pkgs.sal}/bin/sal";
|
||||||
|
"End" = "exec rofi -show calc";
|
||||||
|
"${modifier}+Shift+r" = "reload";
|
||||||
|
"${modifier}+Shift+c" = "kill";
|
||||||
|
"${modifier}+Shift+q" = "exit";
|
||||||
|
};
|
||||||
|
input = {
|
||||||
|
"*" = {
|
||||||
|
xkb_layout = "us,bg";
|
||||||
|
xkb_options = "grp:win_space_toggle";
|
||||||
|
xkb_variant = ",phonetic";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
swaynag = { inherit (config.wayland.windowManager.sway) enable; };
|
||||||
|
};
|
||||||
|
programs = {
|
||||||
|
waybar = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
mainBar =
|
||||||
|
{
|
||||||
|
layer = "top";
|
||||||
|
position = "top";
|
||||||
|
height = 30;
|
||||||
|
output = [ "eDP-1" "HDMI-A-1" "*" ];
|
||||||
|
|
||||||
|
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
battery = {
|
||||||
|
format = "{icon} <span color='#cdd6f4'>{capacity}% {time}</span>";
|
||||||
|
format-time = " {H} h {M} m";
|
||||||
|
format-icons = [ "" "" "" "" "" ];
|
||||||
|
states = {
|
||||||
|
warning = 30;
|
||||||
|
critical = 15;
|
||||||
|
};
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
cpu = { format = "<span color='#74c7ec'></span> {usage}%"; };
|
||||||
|
|
||||||
|
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 = [ "" "" "" ];
|
||||||
|
};
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
network = {
|
||||||
|
format-ethernet = "<span color='#89dceb'></span> | <span color='#fab387'></span> {bandwidthUpBytes} <span color='#fab387'></span> {bandwidthDownBytes}";
|
||||||
|
format-wifi = "<span color='#06b6d4'>{icon}</span> | <span color='#fab387'></span> {bandwidthUpBytes} <span color='#fab387'></span> {bandwidthDownBytes}";
|
||||||
|
format-disconnected = "<span color='#eba0ac'> no connection</span>";
|
||||||
|
format-icons = [ "" "" "" "" ];
|
||||||
|
interval = 5;
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
"sway/workspaces" = {
|
||||||
|
disable-scroll = true;
|
||||||
|
all-outputs = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd = {
|
||||||
|
enable = true;
|
||||||
|
target = "sway-session.target";
|
||||||
|
};
|
||||||
|
style = ''
|
||||||
|
@define-color rosewater #f5e0dc;
|
||||||
|
@define-color flamingo #f2cdcd;
|
||||||
|
@define-color pink #f5c2e7;
|
||||||
|
@define-color mauve #cba6f7;
|
||||||
|
@define-color red #f38ba8;
|
||||||
|
@define-color maroon #eba0ac;
|
||||||
|
@define-color peach #fab387;
|
||||||
|
@define-color yellow #f9e2af;
|
||||||
|
@define-color green #a6e3a1;
|
||||||
|
@define-color teal #94e2d5;
|
||||||
|
@define-color sky #89dceb;
|
||||||
|
@define-color sapphire #74c7ec;
|
||||||
|
@define-color blue #89b4fa;
|
||||||
|
@define-color lavender #b4befe;
|
||||||
|
@define-color text #cdd6f4;
|
||||||
|
@define-color subtext1 #bac2de;
|
||||||
|
@define-color subtext0 #a6adc8;
|
||||||
|
@define-color overlay2 #9399b2;
|
||||||
|
@define-color overlay1 #7f849c;
|
||||||
|
@define-color overlay0 #6c7086;
|
||||||
|
@define-color surface2 #585b70;
|
||||||
|
@define-color surface1 #45475a;
|
||||||
|
@define-color surface0 #313244;
|
||||||
|
@define-color base #1e1e2e;
|
||||||
|
@define-color mantle #181825;
|
||||||
|
@define-color crust #11111b;
|
||||||
|
* {
|
||||||
|
font-family: FontAwesome, 'Fira Code';
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar {
|
||||||
|
background-color: rgba(43, 48, 59, 0.1);
|
||||||
|
border-bottom: 2px solid rgba(100, 114, 125, 0.5);
|
||||||
|
color: @rosewater;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button {
|
||||||
|
padding: 0 5px;
|
||||||
|
background-color: @base;
|
||||||
|
color: @text;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button:hover {
|
||||||
|
background: @mantle;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.focused {
|
||||||
|
background-color: @crust;
|
||||||
|
box-shadow: inset 0 -2px @sky;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.urgent {
|
||||||
|
background-color: @red;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock,
|
||||||
|
#battery,
|
||||||
|
#cpu,
|
||||||
|
#memory,
|
||||||
|
#disk,
|
||||||
|
#temperature,
|
||||||
|
#backlight,
|
||||||
|
#network,
|
||||||
|
#pulseaudio,
|
||||||
|
#wireplumber,
|
||||||
|
#custom-media,
|
||||||
|
#tray,
|
||||||
|
#mode,
|
||||||
|
#idle_inhibitor,
|
||||||
|
#scratchpad,
|
||||||
|
#power-profiles-daemon,
|
||||||
|
#mpd {
|
||||||
|
padding: 0 10px;
|
||||||
|
color: @text;
|
||||||
|
background-color: @base;
|
||||||
|
margin: 0 .5em;
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock.week {
|
||||||
|
margin-right: 0px;
|
||||||
|
color: @peach;
|
||||||
|
border-radius: 9999px 0px 0px 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock.year {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
color: @pink;
|
||||||
|
border-radius: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock.time {
|
||||||
|
margin-left: 0px;
|
||||||
|
color: @sky;
|
||||||
|
border-radius: 0px 9999px 9999px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery.charging, #battery.plugged {
|
||||||
|
color: @green;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery.discharging {
|
||||||
|
color: @yellow;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blink {
|
||||||
|
to {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery.warning:not(.charging) {
|
||||||
|
background-color: @red;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Using steps() instead of linear as a timing function to limit cpu usage */
|
||||||
|
#battery.critical:not(.charging) {
|
||||||
|
background-color: @red;
|
||||||
|
animation-name: blink;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-timing-function: steps(12);
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-direction: alternate;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
swaylock = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
show-failed-attempts = true;
|
||||||
|
image = config.home.homeDirectory + "/pic/bg.png";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
rofi = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.rofi-wayland.override {
|
||||||
|
plugins = with pkgs; [
|
||||||
|
(
|
||||||
|
rofi-calc.override
|
||||||
|
{
|
||||||
|
rofi-unwrapped = rofi-wayland-unwrapped;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
extraConfig = {
|
||||||
|
modi = "window,drun,run,ssh,calc";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
kitty = {
|
||||||
|
enable = true;
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.user = {
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
Service = {
|
||||||
|
ExecStart = [ "${pkgs.wpd}/bin/wpd" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
xdg.mimeApps.defaultApplications = {
|
||||||
|
"image/jpg" = "imv.desktop";
|
||||||
|
"image/jpeg" = "imv.desktop";
|
||||||
|
"image/png" = "imv.desktop";
|
||||||
|
"image/webp" = "imv.desktop";
|
||||||
|
"image/gif" = "imv.desktop";
|
||||||
|
"image/svg+xml" = "imv.desktop";
|
||||||
|
"video/mp4" = "mpv.desktop";
|
||||||
|
"video/mpeg" = "mpv.desktop";
|
||||||
|
"video/ogg" = "mpv.desktop";
|
||||||
|
"video/webm" = "mpv.desktop";
|
||||||
|
"video/x-msvideo" = "mpv.desktop";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
web = moduleWithSystem (
|
||||||
|
_: _: {
|
||||||
|
programs = {
|
||||||
|
browserpass.enable = true;
|
||||||
|
firefox = {
|
||||||
|
enable = true;
|
||||||
|
profiles.ivand = {
|
||||||
|
id = 0;
|
||||||
|
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/";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
"general.smoothScroll" = true;
|
||||||
|
"signon.rememberSignons" = false;
|
||||||
|
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
|
||||||
|
"layout.frame_rate" = 60;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
policies = {
|
||||||
|
CaptivePortal = false;
|
||||||
|
DisableFirefoxStudies = true;
|
||||||
|
DisablePocket = true;
|
||||||
|
DisableTelemetry = true;
|
||||||
|
DisableFirefoxAccounts = true;
|
||||||
|
OfferToSaveLogins = false;
|
||||||
|
OfferToSaveLoginsDefault = false;
|
||||||
|
PasswordManagerEnabled = false;
|
||||||
|
NoDefaultBookmarks = true;
|
||||||
|
PopupBlocking.Default = false;
|
||||||
|
PromptForDownloadLocation = false;
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
Handlers = {
|
||||||
|
schemes = {
|
||||||
|
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";
|
||||||
|
"x-scheme-handler/http" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/https" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/about" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/unknown" = "firefox.desktop";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
@ -1,13 +0,0 @@
|
|||||||
{ system, nixpkgs, pkgs, ide, ... }:
|
|
||||||
{
|
|
||||||
nixos = {
|
|
||||||
gaming = import ./nixos/gaming { inherit nixpkgs; };
|
|
||||||
nvidia = import ./nixos/nvidia { inherit nixpkgs; };
|
|
||||||
dnscrypt = import ./nixos/dnscrypt;
|
|
||||||
wireguard = import ./nixos/wireguard;
|
|
||||||
};
|
|
||||||
home = {
|
|
||||||
packages = import ./home/packages pkgs;
|
|
||||||
programs = import ./home/programs { inherit system pkgs ide; };
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
pkgs: with pkgs; {
|
|
||||||
dev = [
|
|
||||||
openssh
|
|
||||||
procs
|
|
||||||
ripgrep
|
|
||||||
fswatch
|
|
||||||
];
|
|
||||||
essential = [
|
|
||||||
gopass
|
|
||||||
ffmpeg
|
|
||||||
transmission
|
|
||||||
];
|
|
||||||
random = [
|
|
||||||
telegram-desktop
|
|
||||||
xonotic
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
programs.bat = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
programs.bottom = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.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; }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
programs.carapace = {
|
|
||||||
enable = true;
|
|
||||||
enableNushellIntegration = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{ pkgs }: {
|
|
||||||
programs.chromium = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.ungoogled-chromium;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
services.cliphist = {
|
|
||||||
enable = true;
|
|
||||||
systemdTarget = "sway-session.target";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
programs = {
|
|
||||||
nix-index-database.comma.enable = true;
|
|
||||||
nix-index.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
{ system, pkgs, ide, ... }: {
|
|
||||||
|
|
||||||
nvim = import ./neovim {
|
|
||||||
nvim = ide.nvim.${system}.homeManagerModules.nvim;
|
|
||||||
};
|
|
||||||
bat = import ./bat;
|
|
||||||
bottom = import ./bottom;
|
|
||||||
browserpass = { programs.browserpass.enable = true; };
|
|
||||||
carapace = import ./carapace;
|
|
||||||
chromium = import ./chromium { inherit pkgs; };
|
|
||||||
cliphist = import ./cliphist;
|
|
||||||
comma = import ./comma;
|
|
||||||
firefox = import ./firefox { inherit pkgs; };
|
|
||||||
git = import ./git;
|
|
||||||
gpg = import ./gpg { inherit pkgs; };
|
|
||||||
imv = import ./imv;
|
|
||||||
mako = import ./mako;
|
|
||||||
kitty = import ./kitty { inherit pkgs; };
|
|
||||||
lf = import ./lf;
|
|
||||||
mpv = import ./mpv;
|
|
||||||
nushell = import ./nushell { inherit pkgs; };
|
|
||||||
obs-studio = import ./obs-studio { inherit pkgs; };
|
|
||||||
pueue = import ./pueue;
|
|
||||||
rofi = import ./rofi { inherit pkgs; };
|
|
||||||
starship = import ./starship;
|
|
||||||
sway = import ./sway { inherit pkgs; };
|
|
||||||
swaylock = import ./swaylock;
|
|
||||||
tealdeer = import ./tealdeer;
|
|
||||||
tmux = import ./tmux { inherit pkgs; };
|
|
||||||
waybar = import ./waybar;
|
|
||||||
zsh = import ./zsh { inherit pkgs; };
|
|
||||||
}
|
|
@ -1,74 +0,0 @@
|
|||||||
{ pkgs }: {
|
|
||||||
programs.firefox = {
|
|
||||||
enable = true;
|
|
||||||
profiles.ivand = {
|
|
||||||
id = 0;
|
|
||||||
search.default = "DuckDuckGo";
|
|
||||||
bookmarks = [
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
"signon.rememberSignons" = false;
|
|
||||||
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
|
|
||||||
"layout.frame_rate" = 120;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
policies = {
|
|
||||||
CaptivePortal = false;
|
|
||||||
DisableFirefoxStudies = true;
|
|
||||||
DisablePocket = true;
|
|
||||||
DisableTelemetry = true;
|
|
||||||
DisableFirefoxAccounts = true;
|
|
||||||
OfferToSaveLogins = false;
|
|
||||||
OfferToSaveLoginsDefault = false;
|
|
||||||
PasswordManagerEnabled = false;
|
|
||||||
|
|
||||||
FirefoxHome = {
|
|
||||||
Search = true;
|
|
||||||
Pocket = false;
|
|
||||||
Snippets = false;
|
|
||||||
TopSites = false;
|
|
||||||
Highlights = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
UserMessaging = {
|
|
||||||
ExtensionRecommendations = false;
|
|
||||||
SkipOnboarding = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
Handlers = {
|
|
||||||
schemes = {
|
|
||||||
mailto = {
|
|
||||||
action = "useHelperApp";
|
|
||||||
ask = false;
|
|
||||||
handlers = [
|
|
||||||
{
|
|
||||||
name = "RoundCube";
|
|
||||||
uriTemplate = "https://mail.idimitrov.dev/?_task=mail&_action=compose&_to=%s";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home = {
|
|
||||||
file.".mozilla/native-messaging-hosts/gpgmejson.json".text = builtins.toJSON {
|
|
||||||
name = "gpgmejson";
|
|
||||||
description = "Integration with GnuPG";
|
|
||||||
path = "${pkgs.gpgme.dev}/bin/gpgme-json";
|
|
||||||
type = "stdio";
|
|
||||||
allowed_extensions = [
|
|
||||||
"jid1-AQqSMBYb0a8ADg@jetpack"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
delta.enable = true;
|
|
||||||
userName = "Ivan Kirilov Dimitrov";
|
|
||||||
userEmail = "ivan@idimitrov.dev";
|
|
||||||
signing = {
|
|
||||||
signByDefault = true;
|
|
||||||
key = "ivan@idimitrov.dev";
|
|
||||||
};
|
|
||||||
extraConfig = {
|
|
||||||
color.ui = "auto";
|
|
||||||
pull.rebase = true;
|
|
||||||
push.autoSetupRemote = true;
|
|
||||||
};
|
|
||||||
aliases = {
|
|
||||||
a = "add .";
|
|
||||||
c = "commit";
|
|
||||||
d = "diff --cached";
|
|
||||||
p = "push";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
{ pkgs, ... }: {
|
|
||||||
programs.gpg = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
services.gpg-agent = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
enableNushellIntegration = true;
|
|
||||||
pinentryPackage = pkgs.pinentry-qt;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
programs.imv = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
{ pkgs, ... }: {
|
|
||||||
programs.kitty = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
font = {
|
|
||||||
package = pkgs.fira-code;
|
|
||||||
name = "FiraCodeNFM-Reg";
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
enable_tab_bar = false;
|
|
||||||
background_opacity = "0.96";
|
|
||||||
cursor_shape = "beam";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
programs.lf = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = builtins.readFile ./lfrc;
|
|
||||||
keybindings = {
|
|
||||||
D = "trash";
|
|
||||||
T = "touch";
|
|
||||||
M = "mkdir";
|
|
||||||
R = "mv";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
# Basic Settings
|
|
||||||
set hidden true
|
|
||||||
set ignorecase true
|
|
||||||
set icons true
|
|
||||||
|
|
||||||
# Custom Functions
|
|
||||||
|
|
||||||
cmd trash ${{
|
|
||||||
files=$(printf "$fx" | tr '\n' ';')
|
|
||||||
while [ "$files" ]; do
|
|
||||||
file=${files%%;*}
|
|
||||||
|
|
||||||
rm -rf "$(basename "$file")"
|
|
||||||
if [ "$files" = "$file" ]; then
|
|
||||||
files=''
|
|
||||||
else
|
|
||||||
files="${files#*;}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}}
|
|
||||||
|
|
||||||
cmd mkdir ${{
|
|
||||||
printf "Directory Name: "
|
|
||||||
read ans
|
|
||||||
mkdir "$ans"
|
|
||||||
}}
|
|
||||||
|
|
||||||
cmd touch ${{
|
|
||||||
printf "File Name: "
|
|
||||||
read ans
|
|
||||||
touch "$ans"
|
|
||||||
}}
|
|
||||||
|
|
||||||
cmd mv ${{
|
|
||||||
printf "Move to: "
|
|
||||||
read ans
|
|
||||||
mv "$f" "$ans"
|
|
||||||
}}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
services.mako = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
programs.mpv = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
{ nvim, ... }:
|
|
||||||
nvim
|
|
||||||
{
|
|
||||||
enable = true;
|
|
||||||
plugins.lsp.servers = {
|
|
||||||
bashls.enable = true;
|
|
||||||
nushell.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
{ pkgs, ... }: {
|
|
||||||
programs.nushell = {
|
|
||||||
enable = true;
|
|
||||||
environmentVariables = {
|
|
||||||
config = ''
|
|
||||||
{
|
|
||||||
show_banner: false,
|
|
||||||
completions: {
|
|
||||||
quick: false
|
|
||||||
partial: false
|
|
||||||
algorithm: "prefix"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
PATH = "($env.PATH | split row (char esep) | append ($env.HOME | path join .local bin))";
|
|
||||||
};
|
|
||||||
shellAliases = {
|
|
||||||
gcal = ''
|
|
||||||
bash -c "cal $(date +%Y)"
|
|
||||||
'';
|
|
||||||
la = "ls -al";
|
|
||||||
dev = "nix develop --command $env.SHELL";
|
|
||||||
torrent = "transmission-remote";
|
|
||||||
vi = "nvim";
|
|
||||||
sc = "systemctl";
|
|
||||||
neofetch = "${pkgs.fastfetch}/bin/fastfetch -c all.jsonc";
|
|
||||||
};
|
|
||||||
loginFile.text = ''
|
|
||||||
if (tty) == "/dev/tty1" {
|
|
||||||
sway
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{ pkgs }: {
|
|
||||||
programs.obs-studio = {
|
|
||||||
enable = true;
|
|
||||||
plugins = with pkgs.obs-studio-plugins; [ wlrobs ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
services.pueue = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
{ pkgs, ... }: {
|
|
||||||
programs.rofi = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
package = pkgs.rofi-wayland.override {
|
|
||||||
plugins = with pkgs; [
|
|
||||||
(
|
|
||||||
rofi-calc.override
|
|
||||||
{
|
|
||||||
rofi-unwrapped = rofi-wayland-unwrapped;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
extraConfig = {
|
|
||||||
modi = "window,drun,run,ssh,calc";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
programs.starship = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
enableNushellIntegration = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,69 +0,0 @@
|
|||||||
{ pkgs, ... }: {
|
|
||||||
wayland.windowManager.sway = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
systemd.enable = true;
|
|
||||||
config = rec {
|
|
||||||
menu = "rofi -show run";
|
|
||||||
terminal = "kitty";
|
|
||||||
modifier = "Mod4";
|
|
||||||
startup = [
|
|
||||||
{ command = "swaymsg 'workspace 1; exec kitty'"; }
|
|
||||||
{ command = "swaymsg 'workspace 2; exec firefox'"; }
|
|
||||||
];
|
|
||||||
bars = [ ];
|
|
||||||
window.titlebar = false;
|
|
||||||
keybindings = pkgs.lib.mkOptionDefault {
|
|
||||||
# System
|
|
||||||
"End" = "exec systemctl poweroff";
|
|
||||||
"Insert" = "exec systemctl reboot";
|
|
||||||
# Audio
|
|
||||||
"XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
|
||||||
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
|
||||||
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
|
||||||
"Alt+XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ +5%";
|
|
||||||
"Alt+XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ -5%";
|
|
||||||
"XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
|
||||||
# Display
|
|
||||||
"Alt+Shift+l" = "exec ${pkgs.swaylock}/bin/swaylock"; # Lock screen
|
|
||||||
"XF86ScreenSaver" = "output 'eDP-1' toggle"; # Turn screen off
|
|
||||||
"XF86MonBrightnessUp" = "exec doas ${pkgs.light}/bin/light -A 10";
|
|
||||||
"XF86MonBrightnessDown" = "exec doas ${pkgs.light}/bin/light -U 10";
|
|
||||||
# Programs
|
|
||||||
"${modifier}+p" = "exec ${menu}";
|
|
||||||
"${modifier}+Shift+a" = "exec screenshot area";
|
|
||||||
"${modifier}+Shift+s" = "exec screenshot";
|
|
||||||
"XF86Calculator" = "exec rofi -show calc";
|
|
||||||
# sway commands
|
|
||||||
"${modifier}+Shift+r" = "reload";
|
|
||||||
"${modifier}+Shift+c" = "kill";
|
|
||||||
"${modifier}+Shift+q" = "exit";
|
|
||||||
};
|
|
||||||
input = {
|
|
||||||
"*" = {
|
|
||||||
xkb_layout = "us,bg";
|
|
||||||
xkb_options = "grp:win_space_toggle";
|
|
||||||
xkb_variant = ",phonetic";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
swaynag = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
audacity
|
|
||||||
gimp
|
|
||||||
grim
|
|
||||||
libnotify
|
|
||||||
libreoffice-qt
|
|
||||||
mupdf
|
|
||||||
pavucontrol
|
|
||||||
scripts
|
|
||||||
slurp
|
|
||||||
wl-clipboard
|
|
||||||
xdg-user-dirs
|
|
||||||
xdg-utils
|
|
||||||
xwayland
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
{ config, ... }: {
|
|
||||||
programs.swaylock = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
settings = {
|
|
||||||
show-failed-attempts = true;
|
|
||||||
image = config.home.homeDirectory + "/pic/bg.png";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
programs.tealdeer = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
display = {
|
|
||||||
compact = true;
|
|
||||||
};
|
|
||||||
updates = {
|
|
||||||
auto_update = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
{ pkgs, ... }: {
|
|
||||||
programs.tmux = {
|
|
||||||
enable = true;
|
|
||||||
clock24 = true;
|
|
||||||
baseIndex = 1;
|
|
||||||
escapeTime = 0;
|
|
||||||
keyMode = "vi";
|
|
||||||
shell = "\${SHELL}";
|
|
||||||
terminal = "screen-256color";
|
|
||||||
plugins = with pkgs.tmuxPlugins; [ tilish catppuccin ];
|
|
||||||
extraConfig = ''
|
|
||||||
set-option -a terminal-features 'screen-256color:RGB'
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,103 +0,0 @@
|
|||||||
{
|
|
||||||
programs.waybar = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
settings = {
|
|
||||||
mainBar =
|
|
||||||
let
|
|
||||||
calendar = {
|
|
||||||
mode = "year";
|
|
||||||
mode-mon-col = 3;
|
|
||||||
weeks-pos = "right";
|
|
||||||
format = {
|
|
||||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
|
||||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
|
||||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
|
||||||
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
|
||||||
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tooltip-format = "<tt><small>{calendar}</small></tt>";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
layer = "top";
|
|
||||||
position = "top";
|
|
||||||
height = 30;
|
|
||||||
output = [
|
|
||||||
"eDP-1"
|
|
||||||
"HDMI-A-1"
|
|
||||||
];
|
|
||||||
modules-left = [ "sway/workspaces" ];
|
|
||||||
modules-center = [ "clock#week" "clock#year" "clock#time" ];
|
|
||||||
modules-right = [ "network" "pulseaudio" "memory" "cpu" "battery" ];
|
|
||||||
|
|
||||||
"clock#time" = {
|
|
||||||
format = "{:%H:%M:%S}";
|
|
||||||
interval = 1;
|
|
||||||
tooltip-format = tooltip-format;
|
|
||||||
calendar = calendar;
|
|
||||||
};
|
|
||||||
|
|
||||||
"clock#week" = {
|
|
||||||
format = "{:%a}";
|
|
||||||
tooltip-format = tooltip-format;
|
|
||||||
calendar = calendar;
|
|
||||||
};
|
|
||||||
|
|
||||||
"clock#year" = {
|
|
||||||
format = "{:%Y-%m-%d}";
|
|
||||||
tooltip-format = tooltip-format;
|
|
||||||
calendar = calendar;
|
|
||||||
};
|
|
||||||
|
|
||||||
battery = {
|
|
||||||
format = "{icon} <span color='#cdd6f4'>{capacity}% {time}</span>";
|
|
||||||
format-time = " {H} h {M} m";
|
|
||||||
format-icons = [ "" "" "" "" "" ];
|
|
||||||
states = {
|
|
||||||
warning = 30;
|
|
||||||
critical = 15;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
cpu = {
|
|
||||||
format = "<span color='#74c7ec'></span> {usage}%";
|
|
||||||
};
|
|
||||||
|
|
||||||
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 = [ "" "" "" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
network = {
|
|
||||||
format-ethernet = "<span color='#89dceb'></span> | <span color='#fab387'></span> {bandwidthUpBytes} <span color='#fab387'></span> {bandwidthDownBytes}";
|
|
||||||
format-wifi = "<span color='#06b6d4'>{icon}</span> | <span color='#fab387'></span> {bandwidthUpBytes} <span color='#fab387'></span> {bandwidthDownBytes}";
|
|
||||||
format-disconnected = "<span color='#eba0ac'> no connection</span>";
|
|
||||||
format-icons = [ "" "" "" "" ];
|
|
||||||
interval = 5;
|
|
||||||
};
|
|
||||||
|
|
||||||
"sway/workspaces" = {
|
|
||||||
disable-scroll = true;
|
|
||||||
all-outputs = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd = {
|
|
||||||
enable = true;
|
|
||||||
target = "sway-session.target";
|
|
||||||
};
|
|
||||||
style = builtins.readFile ./style.css;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,102 +0,0 @@
|
|||||||
* {
|
|
||||||
font-family: FontAwesome, 'Fira Code';
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
window#waybar {
|
|
||||||
background-color: rgba(43, 48, 59, 0.1);
|
|
||||||
border-bottom: 2px solid rgba(100, 114, 125, 0.5);
|
|
||||||
color: @rosewater;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspaces button {
|
|
||||||
padding: 0 5px;
|
|
||||||
background-color: @base;
|
|
||||||
color: @text;
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspaces button:hover {
|
|
||||||
background: @mantle;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspaces button.focused {
|
|
||||||
background-color: @crust;
|
|
||||||
box-shadow: inset 0 -2px @sky;
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspaces button.urgent {
|
|
||||||
background-color: @red;
|
|
||||||
}
|
|
||||||
|
|
||||||
#clock,
|
|
||||||
#battery,
|
|
||||||
#cpu,
|
|
||||||
#memory,
|
|
||||||
#disk,
|
|
||||||
#temperature,
|
|
||||||
#backlight,
|
|
||||||
#network,
|
|
||||||
#pulseaudio,
|
|
||||||
#wireplumber,
|
|
||||||
#custom-media,
|
|
||||||
#tray,
|
|
||||||
#mode,
|
|
||||||
#idle_inhibitor,
|
|
||||||
#scratchpad,
|
|
||||||
#power-profiles-daemon,
|
|
||||||
#mpd {
|
|
||||||
padding: 0 10px;
|
|
||||||
color: @text;
|
|
||||||
background-color: @base;
|
|
||||||
margin: 0 .5em;
|
|
||||||
border-radius: 9999px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#clock.week {
|
|
||||||
margin-right: 0px;
|
|
||||||
color: @peach;
|
|
||||||
border-radius: 9999px 0px 0px 9999px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#clock.year {
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
color: @pink;
|
|
||||||
border-radius: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#clock.time {
|
|
||||||
margin-left: 0px;
|
|
||||||
color: @sky;
|
|
||||||
border-radius: 0px 9999px 9999px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#battery.charging, #battery.plugged {
|
|
||||||
color: @green;
|
|
||||||
}
|
|
||||||
|
|
||||||
#battery.discharging {
|
|
||||||
color: @yellow;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes blink {
|
|
||||||
to {
|
|
||||||
background-color: #ffffff;
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#battery.warning:not(.charging) {
|
|
||||||
background-color: @red;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Using steps() instead of linear as a timing function to limit cpu usage */
|
|
||||||
#battery.critical:not(.charging) {
|
|
||||||
background-color: @red;
|
|
||||||
animation-name: blink;
|
|
||||||
animation-duration: 0.5s;
|
|
||||||
animation-timing-function: steps(12);
|
|
||||||
animation-iteration-count: infinite;
|
|
||||||
animation-direction: alternate;
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
programs.zsh = {
|
|
||||||
enable = true;
|
|
||||||
syntaxHighlighting.enable = true;
|
|
||||||
autosuggestion.enable = true;
|
|
||||||
loginExtra = ''
|
|
||||||
[ "$(tty)" = "/dev/tty1" ] && exec sway
|
|
||||||
'';
|
|
||||||
shellAliases = {
|
|
||||||
cal = "cal $(date +%Y)";
|
|
||||||
GG = "git add . && git commit -m 'GG' && git push --set-upstream origin HEAD";
|
|
||||||
gad = "git add . && git diff --cached";
|
|
||||||
gac = "ga && gc";
|
|
||||||
gach = "gac -C HEAD";
|
|
||||||
ga = "git add .";
|
|
||||||
gc = "git commit";
|
|
||||||
dev = "nix develop --command $SHELL";
|
|
||||||
ls = "${pkgs.nushell}/bin/nu -c 'ls'";
|
|
||||||
la = "${pkgs.nushell}/bin/nu -c 'ls -al'";
|
|
||||||
torrent = "transmission-remote";
|
|
||||||
vi = "nvim";
|
|
||||||
sc = "systemctl";
|
|
||||||
};
|
|
||||||
shellGlobalAliases = {
|
|
||||||
comp = "-vcodec libx265 -crf 28";
|
|
||||||
};
|
|
||||||
history = {
|
|
||||||
expireDuplicatesFirst = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
networking.wg-quick.interfaces = {
|
|
||||||
wg0 = {
|
|
||||||
address = [ "10.0.0.2/24" "fdc9:281f:04d7:9ee9::2/64" ];
|
|
||||||
dns = [ "1.1.1.1" "fdc9:281f:04d7:9ee9::1" ];
|
|
||||||
privateKeyFile = "/etc/wireguard/privatekey";
|
|
||||||
|
|
||||||
peers = [
|
|
||||||
{
|
|
||||||
publicKey = "5FiTLnzbgcbgQLlyVyYeESEd+2DtwM1JHCGz/32UcEU=";
|
|
||||||
allowedIPs = [ "0.0.0.0/0" "::/0" ];
|
|
||||||
endpoint = "37.205.13.29:51820";
|
|
||||||
persistentKeepalive = 25;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
41
nixos/configs/default.nix
Normal file
41
nixos/configs/default.nix
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
toplevel @ { inputs
|
||||||
|
, withSystem
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
mods = toplevel.config.flake.nixosModules;
|
||||||
|
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 ({ inputs', pkgs, ... }:
|
||||||
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs inputs' pkgs;
|
||||||
|
};
|
||||||
|
modules = [ hardware ] ++ modules;
|
||||||
|
});
|
||||||
|
novaConfig = mods:
|
||||||
|
configWithModules {
|
||||||
|
hardware = hardwareConfigurations.nova;
|
||||||
|
modules = essential ++ desktop ++ mods;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
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 ]);
|
||||||
|
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,13 +1,3 @@
|
|||||||
{ stateVersion, system, nixpkgs, modules, hosts, catppuccin, ... }: {
|
{...}: {
|
||||||
laptop = nixpkgs.lib.nixosSystem {
|
imports = [./modules ./configs];
|
||||||
inherit system;
|
|
||||||
modules = [
|
|
||||||
{ system.stateVersion = stateVersion; }
|
|
||||||
../hardware-configuration.nix
|
|
||||||
./laptop
|
|
||||||
modules.nixos.wireguard
|
|
||||||
hosts.nixosModule
|
|
||||||
catppuccin.nixosModules.catppuccin
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1,180 +0,0 @@
|
|||||||
{ config, pkgs, ... }: {
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware = {
|
|
||||||
opengl = {
|
|
||||||
enable = true;
|
|
||||||
driSupport = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
catppuccin = {
|
|
||||||
enable = true;
|
|
||||||
flavor = "mocha";
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
loader = {
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
catppuccin.enable = true;
|
|
||||||
useOSProber = true;
|
|
||||||
efiSupport = true;
|
|
||||||
device = "nodev";
|
|
||||||
};
|
|
||||||
efi = {
|
|
||||||
canTouchEfiVariables = true;
|
|
||||||
efiSysMountPoint = "/boot/efi";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
|
||||||
kernelModules = [ "v4l2loopback" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
security = {
|
|
||||||
sudo = {
|
|
||||||
enable = false;
|
|
||||||
execWheelOnly = true;
|
|
||||||
extraRules = [
|
|
||||||
{
|
|
||||||
groups = [ "wheel" ];
|
|
||||||
commands = [{ command = "${pkgs.light}/bin/light"; options = [ "SETENV" "NOPASSWD" ]; }];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
doas = {
|
|
||||||
enable = true;
|
|
||||||
extraRules = [
|
|
||||||
# Allow wheel to run all commands without password and keep user env.
|
|
||||||
{ groups = [ "wheel" ]; noPass = true; keepEnv = true; }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
polkit.enable = true;
|
|
||||||
rtkit.enable = true;
|
|
||||||
pam = { services = { swaylock = { }; }; };
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg = {
|
|
||||||
portal = {
|
|
||||||
enable = true;
|
|
||||||
wlr.enable = true;
|
|
||||||
config.common.default = "*";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
i18n.supportedLocales = [ "all" ];
|
|
||||||
|
|
||||||
time.timeZone = "Europe/Prague";
|
|
||||||
|
|
||||||
fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ];
|
|
||||||
|
|
||||||
environment = {
|
|
||||||
systemPackages = with pkgs; [
|
|
||||||
cmatrix
|
|
||||||
coreutils-full
|
|
||||||
cryptsetup
|
|
||||||
dig
|
|
||||||
fd
|
|
||||||
file
|
|
||||||
git
|
|
||||||
glibc
|
|
||||||
gnumake
|
|
||||||
jq
|
|
||||||
mlocate
|
|
||||||
moreutils
|
|
||||||
ntfs3g
|
|
||||||
openssl
|
|
||||||
srm
|
|
||||||
unzip
|
|
||||||
vim
|
|
||||||
zip
|
|
||||||
];
|
|
||||||
shells = with pkgs; [ zsh nushell ];
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
wireless = {
|
|
||||||
enable = true;
|
|
||||||
networks = {
|
|
||||||
"Smart-Hostel-2.4" = {
|
|
||||||
psk = "smarttrans.bg";
|
|
||||||
};
|
|
||||||
"Yohohostel2.4G" = {
|
|
||||||
psk = "kaskamaska";
|
|
||||||
};
|
|
||||||
"Nomado_Guest" = {
|
|
||||||
psk = "welcomehome";
|
|
||||||
};
|
|
||||||
"HostelMusala Uni" = {
|
|
||||||
psk = "mhostelm";
|
|
||||||
};
|
|
||||||
"BOUTIQUE APARTMENTS" = {
|
|
||||||
psk = "boutique26";
|
|
||||||
};
|
|
||||||
"Safestay" = {
|
|
||||||
psk = "AlldayrooftopBAR";
|
|
||||||
};
|
|
||||||
"HOSTEL JASMIN 2" = {
|
|
||||||
psk = "Jasmin2024";
|
|
||||||
};
|
|
||||||
"HOME" = {
|
|
||||||
psk = "iloveprague";
|
|
||||||
};
|
|
||||||
"Vodafone-B925" = {
|
|
||||||
psk = "7aGh3FE6pN4p4cu6";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
stevenBlackHosts = {
|
|
||||||
enable = true;
|
|
||||||
blockFakenews = true;
|
|
||||||
blockGambling = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
zsh.enable = true;
|
|
||||||
nix-ld.enable = true;
|
|
||||||
adb.enable = true;
|
|
||||||
dconf.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
users = {
|
|
||||||
defaultUserShell = pkgs.zsh;
|
|
||||||
users = {
|
|
||||||
ivand = {
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [
|
|
||||||
"adbusers"
|
|
||||||
"adm"
|
|
||||||
"audio"
|
|
||||||
"bluetooth"
|
|
||||||
"dialout"
|
|
||||||
"flatpak"
|
|
||||||
"kvm"
|
|
||||||
"mlocate"
|
|
||||||
"render"
|
|
||||||
"video"
|
|
||||||
"wheel"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
extraGroups = { mlocate = { }; };
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
xserver.videoDrivers = [ "nouveau" ];
|
|
||||||
dbus.enable = true;
|
|
||||||
flatpak.enable = true;
|
|
||||||
pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa.enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
658
nixos/modules/default.nix
Normal file
658
nixos/modules/default.nix
Normal file
@ -0,0 +1,658 @@
|
|||||||
|
top @ { inputs, moduleWithSystem, ... }: {
|
||||||
|
flake.nixosModules = {
|
||||||
|
grub = moduleWithSystem (_: { pkgs, ... }: {
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
grub =
|
||||||
|
let
|
||||||
|
theme = pkgs.sleek-grub-theme.override {
|
||||||
|
withBanner = "Hello Ivan";
|
||||||
|
withStyle = "bigSur";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit theme;
|
||||||
|
enable = pkgs.lib.mkDefault true;
|
||||||
|
useOSProber = true;
|
||||||
|
efiSupport = true;
|
||||||
|
device = "nodev";
|
||||||
|
splashImage = "${theme}/background.png";
|
||||||
|
};
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
base = moduleWithSystem (_: { pkgs, ... }: {
|
||||||
|
imports = [ inputs.hosts.nixosModule ];
|
||||||
|
system.stateVersion = top.config.flake.stateVersion;
|
||||||
|
nix = { extraOptions = ''experimental-features = nix-command flakes''; };
|
||||||
|
i18n.supportedLocales = [ "all" ];
|
||||||
|
time.timeZone = "Europe/Prague";
|
||||||
|
environment = {
|
||||||
|
systemPackages = with pkgs; [ cmatrix uutils-coreutils-noprefix cryptsetup fd file git glibc gnumake mlocate openssh openssl procs ripgrep srm unzip vim zip just nixos-install-tools tshark ];
|
||||||
|
sessionVariables = { MAKEFLAGS = "-j 4"; };
|
||||||
|
shells = with pkgs; [ bash zsh nushell ];
|
||||||
|
enableAllTerminfo = true;
|
||||||
|
};
|
||||||
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
programs = {
|
||||||
|
zsh.enable = true;
|
||||||
|
nix-ld.enable = true;
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
dbus.enable = true;
|
||||||
|
logind = {
|
||||||
|
killUserProcesses = true;
|
||||||
|
powerKeyLongPress = "reboot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
networking = {
|
||||||
|
stevenBlackHosts = {
|
||||||
|
enable = true;
|
||||||
|
blockFakenews = true;
|
||||||
|
blockGambling = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
shell = moduleWithSystem (_: { pkgs, ... }: {
|
||||||
|
programs = {
|
||||||
|
starship.enable = true;
|
||||||
|
zsh = {
|
||||||
|
enableBashCompletion = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
autosuggestions = {
|
||||||
|
enable = true;
|
||||||
|
strategy = [ "completion" ];
|
||||||
|
};
|
||||||
|
shellAliases = {
|
||||||
|
cal = "cal $(date +%Y)";
|
||||||
|
GG = "git add . && git commit -m 'GG' && git push --set-upstream origin HEAD";
|
||||||
|
gad = "git add . && git diff --cached";
|
||||||
|
gac = "ga && gc";
|
||||||
|
ga = "git add .";
|
||||||
|
gc = "git commit";
|
||||||
|
dev = "nix develop --command $SHELL";
|
||||||
|
eza = "${pkgs.eza}/bin/eza '--long' '--header' '--icons' '--smart-group' '--mounts' '--octal-permissions' '--git'";
|
||||||
|
ls = "eza";
|
||||||
|
la = "eza --all";
|
||||||
|
lt = "eza --git-ignore --all --tree --level=10";
|
||||||
|
sc = "systemctl";
|
||||||
|
neofetch = "${pkgs.fastfetch}/bin/fastfetch -c all.jsonc";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
sound = moduleWithSystem (_: { pkgs, ... }: {
|
||||||
|
services = {
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.systemPackages = with pkgs; [ pwvucontrol ];
|
||||||
|
});
|
||||||
|
music = moduleWithSystem (_: { pkgs, ... }: {
|
||||||
|
imports = [ inputs.musnix.nixosModules.musnix ];
|
||||||
|
environment.systemPackages = with pkgs; [ guitarix ];
|
||||||
|
services.pipewire = {
|
||||||
|
jack.enable = true;
|
||||||
|
extraConfig = { jack."69-low-latency" = { "jack.properties" = { "node.latency" = "64/48000"; }; }; };
|
||||||
|
};
|
||||||
|
musnix = {
|
||||||
|
enable = true;
|
||||||
|
rtcqs.enable = true;
|
||||||
|
soundcardPciId = "00:1f.3";
|
||||||
|
kernel = {
|
||||||
|
realtime = true;
|
||||||
|
packages = pkgs.linuxPackages-rt;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config.common.default = "*";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
security = moduleWithSystem (_: _: {
|
||||||
|
security = {
|
||||||
|
sudo = {
|
||||||
|
enable = false;
|
||||||
|
execWheelOnly = true;
|
||||||
|
extraRules = [{ groups = [ "wheel" ]; }];
|
||||||
|
};
|
||||||
|
doas = {
|
||||||
|
enable = true;
|
||||||
|
extraRules = [
|
||||||
|
{
|
||||||
|
groups = [ "wheel" ];
|
||||||
|
noPass = true;
|
||||||
|
keepEnv = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
polkit.enable = true;
|
||||||
|
rtkit.enable = true;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
intranet = {
|
||||||
|
networking.wg-quick.interfaces = {
|
||||||
|
wg0 = {
|
||||||
|
address = [ "10.0.0.2/32" ];
|
||||||
|
privateKeyFile = "/etc/wireguard/privatekey";
|
||||||
|
peers = [
|
||||||
|
{
|
||||||
|
publicKey = "5FiTLnzbgcbgQLlyVyYeESEd+2DtwM1JHCGz/32UcEU=";
|
||||||
|
allowedIPs = [ "0.0.0.0/0" "::/0" ];
|
||||||
|
endpoint = "37.205.13.29:51820";
|
||||||
|
persistentKeepalive = 25;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PermitRootLogin = "prohibit-password";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
wireless = {
|
||||||
|
networking = {
|
||||||
|
wireless = {
|
||||||
|
enable = true;
|
||||||
|
networks = {
|
||||||
|
"Smart-Hostel-2.4" = {
|
||||||
|
psk = "smarttrans.bg";
|
||||||
|
};
|
||||||
|
"Yohohostel2.4G" = {
|
||||||
|
psk = "kaskamaska";
|
||||||
|
};
|
||||||
|
"Nomado_Guest" = {
|
||||||
|
psk = "welcomehome";
|
||||||
|
};
|
||||||
|
"HostelMusala Uni" = {
|
||||||
|
psk = "mhostelm";
|
||||||
|
};
|
||||||
|
"BOUTIQUE APARTMENTS" = {
|
||||||
|
psk = "boutique26";
|
||||||
|
};
|
||||||
|
"Safestay" = {
|
||||||
|
psk = "AlldayrooftopBAR";
|
||||||
|
};
|
||||||
|
"HOSTEL JASMIN 2" = {
|
||||||
|
psk = "Jasmin2024";
|
||||||
|
};
|
||||||
|
"HOME" = {
|
||||||
|
psk = "iloveprague";
|
||||||
|
};
|
||||||
|
"Vodafone-B925" = {
|
||||||
|
psk = "7aGh3FE6pN4p4cu6";
|
||||||
|
};
|
||||||
|
"O2WIFIZ_EXT" = {
|
||||||
|
psk = "iloveprague";
|
||||||
|
};
|
||||||
|
"KOTEKLAN_GUEST" = {
|
||||||
|
psk = "koteklankotek";
|
||||||
|
};
|
||||||
|
"TP-Link_BE7A" = {
|
||||||
|
psk = "84665461";
|
||||||
|
};
|
||||||
|
"Post120" = {
|
||||||
|
psk = "9996663333";
|
||||||
|
};
|
||||||
|
"MOONLIGHT2019" = {
|
||||||
|
psk = "seacrets";
|
||||||
|
};
|
||||||
|
"Kaiser Terrasse" = {
|
||||||
|
psk = "Internet12";
|
||||||
|
};
|
||||||
|
"ATHENS-HAWKS" = { };
|
||||||
|
"3G" = {
|
||||||
|
hidden = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ivand = moduleWithSystem (_: { pkgs, ... }:
|
||||||
|
let
|
||||||
|
homeMods = top.config.flake.homeManagerModules;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ inputs.home-manager.nixosModules.default ];
|
||||||
|
home-manager = {
|
||||||
|
backupFileExtension = "bak";
|
||||||
|
useUserPackages = true;
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
users.ivand = { ... }: {
|
||||||
|
imports = with homeMods; [
|
||||||
|
base
|
||||||
|
ivand
|
||||||
|
shell
|
||||||
|
util
|
||||||
|
swayland
|
||||||
|
web
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ];
|
||||||
|
users = {
|
||||||
|
users = {
|
||||||
|
ivand = {
|
||||||
|
isNormalUser = true;
|
||||||
|
createHome = true;
|
||||||
|
extraGroups = [
|
||||||
|
"adbusers"
|
||||||
|
"adm"
|
||||||
|
"audio"
|
||||||
|
"bluetooth"
|
||||||
|
"dialout"
|
||||||
|
"flatpak"
|
||||||
|
"kvm"
|
||||||
|
"mlocate"
|
||||||
|
"realtime"
|
||||||
|
"render"
|
||||||
|
"video"
|
||||||
|
"wheel"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
extraGroups = {
|
||||||
|
mlocate = { };
|
||||||
|
realtime = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
});
|
||||||
|
flatpak = {
|
||||||
|
xdg = {
|
||||||
|
portal = {
|
||||||
|
enable = true;
|
||||||
|
wlr.enable = true;
|
||||||
|
config.common.default = "*";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
};
|
||||||
|
ai = moduleWithSystem (_: _: {
|
||||||
|
services = { ollama.enable = true; };
|
||||||
|
});
|
||||||
|
containers = moduleWithSystem (_: _: {
|
||||||
|
virtualisation.docker = {
|
||||||
|
enable = true;
|
||||||
|
storageDriver = "btrfs";
|
||||||
|
};
|
||||||
|
users.users.ivand.extraGroups = [ "docker" ];
|
||||||
|
});
|
||||||
|
anon = moduleWithSystem (_: { pkgs, ... }: {
|
||||||
|
environment.systemPackages = with pkgs; [ tor-browser ];
|
||||||
|
});
|
||||||
|
cryptocurrency = moduleWithSystem (_: { pkgs, ... }: {
|
||||||
|
environment.systemPackages = with pkgs; [ monero-cli ];
|
||||||
|
services = { monero.enable = true; };
|
||||||
|
});
|
||||||
|
monero-miner = moduleWithSystem (_: _: {
|
||||||
|
services = {
|
||||||
|
xmrig = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
autosave = true;
|
||||||
|
cpu = true;
|
||||||
|
opencl = false;
|
||||||
|
cuda = false;
|
||||||
|
pools = [
|
||||||
|
{
|
||||||
|
url = "pool.supportxmr.com:443";
|
||||||
|
user = "48e9t9xvq4M4HBWomz6whiY624YRCPwgJ7LPXngcc8pUHk6hCuR3k6ENpLGDAhPEHWaju8Z4btxkbENpcwaqWcBvLxyh5cn";
|
||||||
|
keepalive = true;
|
||||||
|
tls = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
vps = moduleWithSystem (_: { ... }: {
|
||||||
|
imports = [
|
||||||
|
inputs.vpsadminos.nixosConfigurations.container
|
||||||
|
];
|
||||||
|
});
|
||||||
|
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"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
8
overlays/default.nix
Normal file
8
overlays/default.nix
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{ withSystem, ... }: {
|
||||||
|
flake.overlays.default = _: _:
|
||||||
|
withSystem "x86_64-linux" (
|
||||||
|
{ config, ... }: with config.packages; {
|
||||||
|
inherit nvim bingwp screenshot cursors wpd webshite sal;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
69
packages/default.nix
Normal file
69
packages/default.nix
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
{ 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 ];
|
||||||
|
};
|
||||||
|
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=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
webshite = inputs.webshite.packages.${system}.default;
|
||||||
|
sal = inputs.sal.packages."x86_64-linux".default;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user