Compare commits
114 Commits
docker-ent
...
master
Author | SHA1 | Date |
---|---|---|
Sam | afaf3c4697 | |
Sam | 16fee36e96 | |
Sam | e374498aa4 | |
Sam | f7ffba2266 | |
Sam | a8e0ae35da | |
Sam | 564d4f6230 | |
Sam | 55d96ce54e | |
Sam | d86a05d7c3 | |
Sam | 5a6dca3b5d | |
Sam | d418d16fa4 | |
Sam | 9fe49f4d79 | |
Sam | 1af24715ff | |
Sam | 6f5f8867fd | |
Sam | c25d56f350 | |
Sam | 3d90deadf9 | |
Sam | f3ad132675 | |
Sam | f6b8aeca69 | |
Sam | 9f5e92d452 | |
Sam | dd94dea696 | |
Sam | 19f0057503 | |
Sam | dabff16a37 | |
Sam | 5fae14f4fc | |
Sam | c51cb70732 | |
Sam | c4ac477d6f | |
Sam | ff300d8542 | |
Sam | e30e731d61 | |
Sam | 07d19c4535 | |
Sam | 2ec9f2db77 | |
Sam | 0e0e2b2ae7 | |
Sam | b26aceec76 | |
Sam | 06f6aa1ffd | |
Sam | 3421360317 | |
Sam | 154b474868 | |
Sam | d5f72ee2fd | |
Sam | 46018fb461 | |
Sam | 621e97d8f1 | |
Sam | ae64001bc7 | |
Sam | 9d287792c6 | |
Sam | c448a8c0cd | |
Sam | 87f30f8ace | |
Sam | a5e41acf63 | |
Sam | 21bdc107eb | |
Sam | d56fc29336 | |
Sam | 9788e0d6e2 | |
Sam | bf30739d8b | |
Sam | f8f662daf7 | |
Sam | 04782f64f5 | |
Sam | cf8c449e5e | |
Sam | f7e23e39c7 | |
Sam | 86f27abb2f | |
Sam | fa060dba70 | |
Sam | f411adbf20 | |
Sam | 5e0230dcdd | |
Sam | 1049ecbd76 | |
Sam | e3a1143ca5 | |
Sam | b991fa4236 | |
Sam | 5f672c2665 | |
Sam | 22ce3e08c2 | |
Sam | 5147d02fa9 | |
Sam | 6fbd5447b8 | |
Sam | 1743869b07 | |
Sam | 0fb3056a4c | |
Sam | 32bf8eca1f | |
Sam | c9409866b7 | |
Sam | c5da58fc3b | |
Sam | 82b0838f5c | |
Sam | 7440a6662f | |
mrsu | 959d734fd1 | |
mrsu | 394a24567b | |
Sam | 6472e085c7 | |
Sam | 937b53db87 | |
Sam | fb7cf9e280 | |
Sam | efb6128704 | |
sam | 539ac37b8a | |
Sam | 22aa6d3fa4 | |
sam | 8e527473ac | |
Sam | db7bce57e7 | |
Sam | 614b9765dd | |
Sam | 4b85810128 | |
Sam | a7c8b86b1f | |
Sam | 89ab4e8f9d | |
Sam | 01ad0238a7 | |
Sam | 688c2c9bcd | |
Sam | b8973040d5 | |
Sam | ba9f593bcd | |
Sam | 3dbe85853e | |
Sam | ba19ee9125 | |
Sam | 8173a0dc94 | |
Sam | 600160bd9a | |
Sam | 5205e606c1 | |
Sam | 5b8a1430fe | |
Sam | 8f458590e2 | |
Sam | bcea6919fb | |
Sam | aa8d4ca3ae | |
Sam | 653901f823 | |
sam | febc33faee | |
Sam | 2f99d05406 | |
Sam | 947ddaca43 | |
Sam | 529fc394ef | |
Sam | 89646a5d6a | |
Sam | 804d6bf4d0 | |
Sam | 491350bc58 | |
Sam | baaaa3e8d6 | |
Sam | 591a9ce48f | |
Sam | 7df7970414 | |
Sam | 052c941e81 | |
Sam | f7695f4d15 | |
Sam | 52a3b85c8f | |
Sam | c9ee7c7e80 | |
Sam | fc2f6f4ca3 | |
Sam | 67e3d9dded | |
Sam | 4fbfbee45b | |
Sam | b8f85256a7 | |
Sam | 271b5958b8 |
128
flake.lock
128
flake.lock
|
@ -40,18 +40,17 @@
|
|||
},
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717408969,
|
||||
"narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=",
|
||||
"lastModified": 1722113426,
|
||||
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "1ebbe68d57457c8cae98145410b164b5477761f4",
|
||||
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -161,11 +160,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719877454,
|
||||
"narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=",
|
||||
"lastModified": 1722555600,
|
||||
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "4e3583423212f9303aa1a6337f8dffb415920e4f",
|
||||
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -174,24 +173,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701680307,
|
||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
|
@ -206,11 +187,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719259945,
|
||||
"narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=",
|
||||
"lastModified": 1724857454,
|
||||
"narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07",
|
||||
"rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -286,11 +267,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1718530513,
|
||||
"narHash": "sha256-BmO8d0r+BVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8=",
|
||||
"lastModified": 1720042825,
|
||||
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "a1fddf0967c33754271761d91a3d921772b30d0e",
|
||||
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -308,11 +289,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719827385,
|
||||
"narHash": "sha256-qs+nU20Sm8czHg3bhGCqiH+8e13BJyRrKONW34g3i50=",
|
||||
"lastModified": 1720042825,
|
||||
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "391ca6e950c2525b4f853cbe29922452c14eda82",
|
||||
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -324,11 +305,11 @@
|
|||
},
|
||||
"impermanence": {
|
||||
"locked": {
|
||||
"lastModified": 1719091691,
|
||||
"narHash": "sha256-AxaLX5cBEcGtE02PeGsfscSb/fWMnyS7zMWBXQWDKbE=",
|
||||
"lastModified": 1724489415,
|
||||
"narHash": "sha256-ey8vhwY/6XCKoh7fyTn3aIQs7WeYSYtLbYEG87VCzX4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "23c1f06316b67cb5dabdfe2973da3785cfe9c34a",
|
||||
"rev": "c7f5b394397398c023000cf843986ee2571a1fd7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -364,11 +345,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719845423,
|
||||
"narHash": "sha256-ZLHDmWAsHQQKnmfyhYSHJDlt8Wfjv6SQhl2qek42O7A=",
|
||||
"lastModified": 1724561770,
|
||||
"narHash": "sha256-zv8C9RNa86CIpyHwPIVO/k+5TfM8ZbjGwOOpTe1grls=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "ec12b88104d6c117871fad55e931addac4626756",
|
||||
"rev": "ac5694a0b855a981e81b4d9f14052e3ff46ca39e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -380,11 +361,11 @@
|
|||
"nix-secrets": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1720263046,
|
||||
"narHash": "sha256-6tJLK4EtB4IXBO4i6P/Ulf03Bd7GaEezT7AebN3VPHA=",
|
||||
"lastModified": 1726340825,
|
||||
"narHash": "sha256-6gv36ea3aAjJH7osZVzVU0GRoJeVR+iwSP9bSaJC+MI=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "33d677fea187322e503f8a56d9c75ff7e7df057c",
|
||||
"revCount": 151,
|
||||
"rev": "73d4d304a201f7db200ffb5955c8a2f521f635a7",
|
||||
"revCount": 160,
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git"
|
||||
},
|
||||
|
@ -426,27 +407,27 @@
|
|||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1719099622,
|
||||
"narHash": "sha256-YzJECAxFt+U5LPYf/pCwW/e1iUd2PF21WITHY9B/BAs=",
|
||||
"lastModified": 1721524707,
|
||||
"narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5e8e3b89adbd0be63192f6e645e0a54080004924",
|
||||
"rev": "556533a23879fc7e5f98dd2e0b31a6911a213171",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "release-23.11",
|
||||
"ref": "release-24.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1719254875,
|
||||
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
|
||||
"lastModified": 1724819573,
|
||||
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
|
||||
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -458,11 +439,11 @@
|
|||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1719426051,
|
||||
"narHash": "sha256-yJL9VYQhaRM7xs0M867ZFxwaONB9T2Q4LnGo1WovuR4=",
|
||||
"lastModified": 1724855419,
|
||||
"narHash": "sha256-WXHSyOF4nBX0cvHN3DfmEMcLOVdKH6tnMk9FQ8wTNRc=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "89c49874fb15f4124bf71ca5f42a04f2ee5825fd",
|
||||
"rev": "ae2fc9e0e42caaf3f068c1bfdc11c71734125e06",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -486,11 +467,11 @@
|
|||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719923896,
|
||||
"narHash": "sha256-/hfE2x9NbT13d53o9uq6MuMipV19pJUQzpsZIhlvsiM=",
|
||||
"lastModified": 1724910205,
|
||||
"narHash": "sha256-eH2yPsTkaGp87rtxATx9d2dGBQUXH3kQPEOTKmaEb0s=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "d384cf656cb1b21d90eee1b007a6ade6f90768f5",
|
||||
"rev": "d150ce320e4eda99d8865bbd4c74ee8c47a88097",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -502,11 +483,11 @@
|
|||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1719596768,
|
||||
"narHash": "sha256-quSWztqqMxvSJIKddYp1D0GdR7Kg8JjEVCIzMbtBTQ4=",
|
||||
"lastModified": 1725083573,
|
||||
"narHash": "sha256-F9WeDQi+U1+y6BDGvW8PYyi9LALbpo4DlpzfZONh5a0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "35e48702118124ec52a071e300f55c78a4b7b338",
|
||||
"rev": "83ead973ba76b6ecf2d72dff9b60b56749e29518",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -538,11 +519,11 @@
|
|||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719268571,
|
||||
"narHash": "sha256-pcUk2Fg5vPXLUEnFI97qaB8hto/IToRfqskFqsjvjb8=",
|
||||
"lastModified": 1723501126,
|
||||
"narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=",
|
||||
"owner": "mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "c2ea1186c0cbfa4d06d406ae50f3e4b085ddc9b3",
|
||||
"rev": "be0eec2d27563590194a9206f551a6f73d52fa34",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -551,21 +532,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -574,11 +540,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1719887753,
|
||||
"narHash": "sha256-p0B2r98UtZzRDM5miGRafL4h7TwGRC4DII+XXHDHqek=",
|
||||
"lastModified": 1724833132,
|
||||
"narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "bdb6355009562d8f9313d9460c0d3860f525bc6c",
|
||||
"rev": "3ffd842a5f50f435d3e603312eefa4790db46af5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
10
flake.nix
10
flake.nix
|
@ -130,6 +130,16 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
citadel = nixpkgs.lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
./hosts/citadel
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
{config, ...}: {
|
||||
imports = [
|
||||
# Import users
|
||||
./users/sam
|
||||
|
||||
./common/core
|
||||
|
||||
# Import optional
|
||||
./common/optional/git.nix
|
||||
./common/optional/sops.nix
|
||||
./common/optional/syncthing.nix
|
||||
./common/optional/desktop/dwm
|
||||
./common/optional/desktop/common/themes/standard-dark.nix
|
||||
./common/optional/notes.nix
|
||||
./common/optional/yazi.nix
|
||||
];
|
||||
|
||||
colorScheme = {
|
||||
slug = "serene";
|
||||
name = "Serene";
|
||||
author = "Bitlab21";
|
||||
palette = {
|
||||
base00 = "#1F1F28";
|
||||
base01 = "#16161D";
|
||||
base02 = "#223249";
|
||||
base03 = "#363646";
|
||||
base04 = "#727169";
|
||||
base05 = "#DCD7BA";
|
||||
base06 = "#C8C093";
|
||||
base07 = "#717C7C";
|
||||
base08 = "#C34043";
|
||||
base09 = "#FFA066";
|
||||
base0A = "#C0A36E";
|
||||
base0B = "#76946A";
|
||||
base0C = "#6A9589";
|
||||
base0D = "#7E9CD8";
|
||||
base0E = "#957FB8";
|
||||
base0F = "#D27E99";
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".Xresources" = {
|
||||
recursive = true;
|
||||
text = ''
|
||||
! st
|
||||
st.alpha: 0.8
|
||||
St.font: monospace:pixelsize=31:antialias=true:autohint=true;
|
||||
St.font2: NotoColorEmoji:pixelsize=24:antialias=true:autohint=true;
|
||||
|
||||
! dwm
|
||||
dwm.borderpx: 6
|
||||
dwm.font: monospace:size=14
|
||||
dwm.col_base00: #${config.colorScheme.colors.base00}
|
||||
dwm.col_base03: #${config.colorScheme.colors.base03}
|
||||
dwm.col_base04: #${config.colorScheme.colors.base04}
|
||||
dwm.col_base05: #${config.colorScheme.colors.base05}
|
||||
dwm.col_base08: #${config.colorScheme.colors.base08}
|
||||
dwm.col_base0B: #${config.colorScheme.colors.base0B}
|
||||
|
||||
! dmenu
|
||||
dmenu.font: monospace:size=14
|
||||
dmenu.font2: NotoColorEmoji:pixelsize=44:antialias=true:autohint=true
|
||||
dmenu.topbar: 1
|
||||
dmenu.normfgcolor: #${config.colorScheme.colors.base05}
|
||||
dmenu.normbgcolor: #${config.colorScheme.colors.base03}
|
||||
dmenu.selfgcolor: #${config.colorScheme.colors.base00}
|
||||
dmenu.selbgcolor: #${config.colorScheme.colors.base0B}
|
||||
|
||||
Nsxiv.window.background: #${config.colorScheme.colors.base03}
|
||||
Nsxiv.window.foreground: #${config.colorScheme.colors.base05}
|
||||
Nsxiv.mark.foreground: #${config.colorScheme.colors.base08}
|
||||
|
||||
Nsxiv.bar.background: #${config.colorScheme.colors.base00}
|
||||
Nsxiv.bar.foreground: #${config.colorScheme.colors.base05}
|
||||
Nsxiv.bar.font: monospace:size=12
|
||||
|
||||
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -26,6 +26,7 @@
|
|||
htop
|
||||
postgresql
|
||||
libqalculate
|
||||
tmux
|
||||
;
|
||||
};
|
||||
home.stateVersion = "24.05";
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
./plugins
|
||||
|
@ -11,10 +14,18 @@
|
|||
# Install home packages needed for nixvim
|
||||
home.packages = [
|
||||
pkgs.nixpkgs-fmt
|
||||
pkgs.black
|
||||
pkgs.yamllint
|
||||
pkgs.yamlfmt
|
||||
pkgs.prettierd
|
||||
pkgs.sqlfmt
|
||||
pkgs.nodePackages_latest.sql-formatter
|
||||
pkgs.alejandra
|
||||
pkgs.shellcheck
|
||||
pkgs.shellharden
|
||||
pkgs.shfmt
|
||||
pkgs.stylua
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
enableMan = true; # install man pages for nixvim options
|
||||
|
@ -42,7 +53,11 @@
|
|||
let wiki_0.index = 'home'
|
||||
let wiki_0.syntax = 'markdown'
|
||||
let wiki_0.ext = '.md'
|
||||
'';
|
||||
|
||||
" ==== dbui
|
||||
let g:db_ui_hide_schemas = ['pg_catalog', 'pg_toast_temp.*', 'pg_toast']
|
||||
let g:db_ui_use_nerd_fonts = 1
|
||||
let g:db_ui_execute_on_save = 0
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Switching buffers
|
||||
{
|
||||
mode = ["n"];
|
||||
action = "<C-W>h";
|
||||
action = "<C-w>h";
|
||||
key = "<S-h>";
|
||||
options = {
|
||||
silent = true;
|
||||
|
@ -11,7 +11,7 @@
|
|||
}
|
||||
{
|
||||
mode = ["n"];
|
||||
action = "<C-W>j";
|
||||
action = "<C-w>j";
|
||||
key = "<S-j>";
|
||||
options = {
|
||||
silent = true;
|
||||
|
@ -19,7 +19,7 @@
|
|||
}
|
||||
{
|
||||
mode = ["n"];
|
||||
action = "<C-W>k";
|
||||
action = "<C-w>k";
|
||||
key = "<S-k>";
|
||||
options = {
|
||||
silent = true;
|
||||
|
@ -27,7 +27,7 @@
|
|||
}
|
||||
{
|
||||
mode = ["n"];
|
||||
action = "<C-W>l";
|
||||
action = "<C-w>l";
|
||||
key = "<S-l>";
|
||||
options = {
|
||||
silent = true;
|
||||
|
@ -81,5 +81,37 @@
|
|||
action = "<cmd>Telescope help_tags<CR>";
|
||||
options = {noremap = true;};
|
||||
}
|
||||
# paste over selected text without yanking it
|
||||
{
|
||||
mode = ["v"];
|
||||
key = "p";
|
||||
action = "\"_dP";
|
||||
options = {noremap = true;};
|
||||
}
|
||||
# resize window
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<Right>";
|
||||
action = ":vertical resize +1<CR>";
|
||||
options = {noremap = true;};
|
||||
}
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<Left>";
|
||||
action = ":vertical resize -1<CR>";
|
||||
options = {noremap = true;};
|
||||
}
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<Down>";
|
||||
action = ":resize -1<CR>";
|
||||
options = {noremap = true;};
|
||||
}
|
||||
{
|
||||
mode = ["n"];
|
||||
key = "<Up>";
|
||||
action = ": resize +1<CR>";
|
||||
options = {noremap = true;};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -31,5 +31,7 @@
|
|||
ignorecase = true;
|
||||
smartcase = true;
|
||||
backspace = "indent,eol,start"; # allow backspace in insert mode
|
||||
spell = true;
|
||||
spelllang = "en_gb";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
programs.nixvim.plugins = {
|
||||
alpha = {
|
||||
enable = true;
|
||||
iconsEnabled = true;
|
||||
theme = "dashboard";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
programs.nixvim.plugins.comment = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
|
@ -6,16 +6,39 @@
|
|||
timeoutMs = 500;
|
||||
};
|
||||
notifyOnError = true;
|
||||
logLevel = "debug";
|
||||
formattersByFt = {
|
||||
html = [["prettierd" "prettier"]];
|
||||
css = [["prettierd" "prettier"]];
|
||||
javascript = [["prettierd" "prettier"]];
|
||||
html = ["prettierd"];
|
||||
css = ["prettierd"];
|
||||
javascript = ["prettierd"];
|
||||
python = ["black"];
|
||||
lua = ["stylua"];
|
||||
nix = ["alejandra"];
|
||||
markdown = [["prettierd" "prettier"]];
|
||||
yaml = ["yamllint" "yamlfmt"];
|
||||
sql = ["sqlfmt"];
|
||||
markdown = ["prettierd"];
|
||||
yaml = ["yamlfmt"];
|
||||
sql = ["sql-formatter"];
|
||||
bash = [
|
||||
"shellcheck"
|
||||
"shellharden"
|
||||
"shfmt"
|
||||
];
|
||||
};
|
||||
formatters = {
|
||||
sql-formatter = {
|
||||
command = "sql-formatter";
|
||||
args = "--config ~/.config/sql-formatter/config.json";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".config/sql-formatter/config.json".text = ''
|
||||
{
|
||||
"language": "postgresql",
|
||||
"tabWidth": 2,
|
||||
"linesBetweenQueries": 1,
|
||||
"expressionWidth": 88,
|
||||
"newlineBeforeSemicolon": true
|
||||
}
|
||||
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
user = config.home.username;
|
||||
in {
|
||||
imports = [
|
||||
./cmp.nix
|
||||
./colorizer.nix
|
||||
|
@ -13,7 +18,10 @@
|
|||
./surround.nix
|
||||
./telescope.nix
|
||||
./treesitter.nix
|
||||
./alpha.nix
|
||||
./fold.nix
|
||||
./todo-comments.nix
|
||||
./oil.nix
|
||||
./comment.nix
|
||||
];
|
||||
|
||||
# Load Plugins that aren't provided as modules by nixvim
|
||||
|
@ -24,29 +32,6 @@
|
|||
pkgs.vimPlugins.vim-dadbod-ui
|
||||
pkgs.vimPlugins.vim-dadbod-completion
|
||||
pkgs.vimPlugins.fugitive
|
||||
|
||||
(pkgs.vimUtils.buildVimPlugin
|
||||
{
|
||||
name = "precognition.nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "tris203";
|
||||
repo = "precognition.nvim";
|
||||
rev = "v1.0.0";
|
||||
sha256 = "sha256-AqWYV/59ugKyOWALOCdycWVm0bZ7qb981xnuw/mAVzM=";
|
||||
};
|
||||
})
|
||||
|
||||
# (pkgs.vimUtils.buildVimPlugin
|
||||
# {
|
||||
# name = "hardtime";
|
||||
# src = pkgs.fetchFromGitHub {
|
||||
# owner = "m4xshen";
|
||||
# repo = "hardtime.nvim ";
|
||||
# rev = "9a4e24f";
|
||||
# #sha256 = "sha256-abe9ZGmL7U9rC+LxC3LO5/bOn8lHke1FCKO0V3TZGs0=";
|
||||
# };
|
||||
# })
|
||||
#
|
||||
(pkgs.vimUtils.buildVimPlugin
|
||||
{
|
||||
name = "buffer_manager.nvim";
|
||||
|
@ -58,6 +43,16 @@
|
|||
};
|
||||
})
|
||||
|
||||
(pkgs.vimUtils.buildVimPlugin
|
||||
{
|
||||
name = "vimwiki-sync";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "michal-h21";
|
||||
repo = "vimwiki-sync";
|
||||
rev = "99eeab3";
|
||||
sha256 = "sha256-cz0dSFphIbQAI4AOqwIUpDBTuj/3xlOkhSlIVMdgsqM=";
|
||||
};
|
||||
})
|
||||
|
||||
# Keep vim-devicons as last entry
|
||||
pkgs.vimPlugins.vim-devicons
|
||||
|
@ -66,11 +61,6 @@
|
|||
-- buffer_manager.nvim
|
||||
local opts = {noremap = true}
|
||||
|
||||
require("precognition").setup(
|
||||
{
|
||||
}
|
||||
)
|
||||
|
||||
require("buffer_manager").setup(
|
||||
{
|
||||
line_keys = "1234567890",
|
||||
|
@ -110,7 +100,28 @@
|
|||
opts
|
||||
)
|
||||
end
|
||||
'';
|
||||
|
||||
-- Setup vimwiki
|
||||
|
||||
vim.g.vimwiki_list = {
|
||||
{
|
||||
syntax = "markdown",
|
||||
ext = ".md",
|
||||
path = "/home/${user}/.local/share/notes",
|
||||
},
|
||||
}
|
||||
|
||||
-- Format function for conform.nvim
|
||||
vim.api.nvim_create_user_command("Format", function(args)
|
||||
local range = nil
|
||||
if args.count ~= -1 then
|
||||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||
range = {
|
||||
start = { args.line1, 0 },
|
||||
["end"] = { args.line2, end_line:len() },
|
||||
}
|
||||
end
|
||||
require("conform").format({ async = true, lsp_format = "fallback", range = range })
|
||||
end, { range = true })
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
programs.nixvim.plugins.nvim-ufo = {
|
||||
enable = true;
|
||||
|
||||
};
|
||||
programs.nixvim.extraConfigLua = ''
|
||||
-- default fold options
|
||||
vim.o.foldcolumn = '1'
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
|
||||
-- nvim_ufo options
|
||||
vim.keymap.set('n', 'zR', require('ufo').openAllFolds, { desc = "Open all folds" })
|
||||
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds, { desc = "Close all folds" })
|
||||
vim.keymap.set('n', 'zK', function()
|
||||
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
||||
if not winid then
|
||||
vim.lsp.buf.hover()
|
||||
end
|
||||
end , { desc = "Peed fold" })
|
||||
|
||||
require("ufo").setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return { 'lsp', 'indent' }
|
||||
end
|
||||
})
|
||||
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
programs.nixvim.plugins.lsp = {
|
||||
programs.nixvim.plugins = {
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
lua-ls = {enable = true;};
|
||||
|
@ -7,9 +8,11 @@
|
|||
bashls = {enable = true;};
|
||||
pyright = {enable = true;};
|
||||
html = {enable = true;};
|
||||
yamlls = { enable = true; };
|
||||
marksman = {enable = true;};
|
||||
#sqls = {enable = true;};
|
||||
ccls = {enable = true;};
|
||||
cssls = {enable = true;};
|
||||
r-language-server = {enable = true;};
|
||||
tsserver = {enable = true;};
|
||||
};
|
||||
keymaps = {
|
||||
lspBuf = {
|
||||
|
@ -33,7 +36,7 @@
|
|||
action = "type_definition";
|
||||
desc = "Type Definition";
|
||||
};
|
||||
K = {
|
||||
gK = {
|
||||
action = "hover";
|
||||
desc = "Hover";
|
||||
};
|
||||
|
@ -48,4 +51,9 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
# TODO: enable otter.nvim when merged into nixvim stable
|
||||
# otter = {
|
||||
# enable = true;
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
programs.nixvim.plugins.oil = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
programs = {
|
||||
nixvim = {
|
||||
plugins.todo-comments = {
|
||||
enable = true;
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
mode = [ "n" ];
|
||||
action = "<cmd>TodoTelescope<cr>";
|
||||
key = "<leader>ft";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
shellAliases = {
|
||||
ll = "ls -l";
|
||||
src = "cd ~/.local/share/src";
|
||||
};
|
||||
history.size = 10000;
|
||||
history.path = "${config.xdg.dataHome}/zsh/history";
|
||||
|
|
|
@ -14,5 +14,9 @@
|
|||
pkgs.xfce.thunar
|
||||
pkgs.kcolorchooser
|
||||
pkgs.zotero
|
||||
pkgs.transmission
|
||||
pkgs.qgis
|
||||
pkgs.mpv
|
||||
pkgs.gnome.simple-scan
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,21 +1,48 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
{pkgs, ...}: {
|
||||
# Prevent error when enabling gtk https://github.com/nix-community/home-manager/issues/3113
|
||||
# error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
|
||||
home.packages = [ pkgs.dconf ];
|
||||
gtk.enable = true;
|
||||
|
||||
home.file = {
|
||||
".icons/bibata".source = "${pkgs.bibata-cursors}/share/icons/Bibata-Modern-Classic";
|
||||
};
|
||||
home.packages = [
|
||||
pkgs.dconf
|
||||
];
|
||||
|
||||
# Get details about theme package
|
||||
#cd $(nix build nixpkgs#kanagawa-gtk-theme --print-out-paths --no-link) && nix run nixpkgs#eza -- --tree --level 4
|
||||
gtk.theme.package = pkgs.kanagawa-gtk-theme;
|
||||
gtk.theme.name = "Kanagawa-B";
|
||||
|
||||
gtk.iconTheme.package = pkgs.kanagawa-icon-theme;
|
||||
gtk.iconTheme.name = "Kanagawa";
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "Kanagawa-B";
|
||||
package = pkgs.kanagawa-gtk-theme;
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.gnome.adwaita-icon-theme;
|
||||
name = "Adwaita";
|
||||
};
|
||||
|
||||
gtk3.extraConfig = {
|
||||
Settings = ''
|
||||
gtk-application-prefer-dark-theme=1
|
||||
'';
|
||||
};
|
||||
|
||||
gtk4.extraConfig = {
|
||||
Settings = ''
|
||||
gtk-application-prefer-dark-theme=1
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
#gtk.theme.package = pkgs.kanagawa-gtk-theme;
|
||||
|
||||
# gtk.cursorTheme = {
|
||||
# name = "Vimix-Cursors";
|
||||
# package = pkgs.vimix-cursor-theme;
|
||||
# };
|
||||
|
||||
# gtk.theme.name = "Kanagawa-B";
|
||||
|
||||
# gtk.iconTheme.package = pkgs.kanagawa-icon-theme;
|
||||
# gtk.iconTheme.name = "Kanagawa";
|
||||
|
||||
qt.enable = true;
|
||||
qt.platformTheme.name = "gtk";
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
./xinitrc.nix
|
||||
./sxhkdrc.nix
|
||||
./picom.nix
|
||||
./xresources.nix
|
||||
./dunst.nix
|
||||
./music_player.nix
|
||||
|
||||
|
@ -17,9 +16,11 @@
|
|||
./scripts/sb-volume.nix
|
||||
./scripts/sb-network-status.nix
|
||||
./scripts/sb-updates.nix
|
||||
./scripts/sb-battery.nix
|
||||
|
||||
# Notification scripts
|
||||
./scripts/dunstify-volume-notification.nix
|
||||
./scripts/dunstify-battery-notification.nix
|
||||
|
||||
# Helper scripts
|
||||
./scripts/emoji-picker.nix
|
||||
|
@ -28,6 +29,8 @@
|
|||
./scripts/get-focused-monitor.nix
|
||||
./scripts/git-commit-ai.nix
|
||||
./scripts/aichat-wrapper.nix
|
||||
./scripts/dmenu-wifi.nix
|
||||
./scripts/battery-status.nix
|
||||
];
|
||||
|
||||
home.packages = [
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#format = ''%I %s %p\n%b'';
|
||||
format = ''<b>%s:</b>\n%b\n\n%a '';
|
||||
|
||||
#TODO dynamic fonts
|
||||
font = "monospace";
|
||||
|
||||
# Options are "left", "center", and "right".
|
||||
|
@ -172,7 +171,7 @@
|
|||
urgency_critical = {
|
||||
background = "#${config.colorScheme.colors.base08}";
|
||||
foreground = "#${config.colorScheme.colors.base05}";
|
||||
frame_color = "#${config.colorScheme.colors.base00}";
|
||||
frame_color = "#${config.colorScheme.colors.base05}";
|
||||
timeout = 0;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
home.file."mus/music_data".source = config.lib.file.mkOutOfStoreSymlink /media/music/music_data;
|
||||
home.file."mus/music_data".source = config.lib.file.mkOutOfStoreSymlink /media/media/music/music_data;
|
||||
|
||||
home.packages = [
|
||||
pkgs.ffmpeg
|
||||
|
@ -39,7 +39,8 @@
|
|||
format "44100:16:2"
|
||||
}
|
||||
|
||||
bind_to_address "127.0.0.1" '';
|
||||
bind_to_address "127.0.0.1"
|
||||
'';
|
||||
musicDirectory = "~/mus/music_data";
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
(pkgs.writeShellScriptBin "battery-status" ''
|
||||
|
||||
# Get the current power consumption of the laptop battery
|
||||
power=$(cat /sys/class/power_supply/BAT0/power_now)
|
||||
power_watts=$(${pkgs.bc}/bin/bc <<< "scale=3; $power / 1000000")
|
||||
|
||||
# Get the current battery charge capacity
|
||||
energy=$(cat /sys/class/power_supply/BAT0/energy_now)
|
||||
|
||||
# Get the current battery status (charging or discharging)
|
||||
battery_status=$(cat /sys/class/power_supply/BAT0/status)
|
||||
|
||||
# Calculate the time remaining until the battery is empty or full
|
||||
if [ "$battery_status" == "Charging" ]; then
|
||||
# Calculate the time remaining until the battery is full
|
||||
hours=$(${pkgs.bc}/bin/bc <<< "scale=2; $power / $energy")
|
||||
hours_int=$(${pkgs.bc}/bin/bc <<< "scale=0; $hours / 1")
|
||||
minutes=$(${pkgs.bc}/bin/bc <<< "scale=0; 60 * ($hours - $hours_int)/1")
|
||||
|
||||
if [ "$hours_int" -gt "0" ]; then
|
||||
# Show hours and minutes if time remaining is greater than or equal to 1 hour
|
||||
echo "Full in: $hours_int hours $minutes minutes"
|
||||
else
|
||||
# Show minutes if time remaining is less than 1 hour
|
||||
echo "Full in: $minutes minutes"
|
||||
fi
|
||||
|
||||
elif [ "$battery_status" == "Discharging" ]; then
|
||||
# Calculate the time remaining until the battery is empty
|
||||
hours=$(${pkgs.bc}/bin/bc <<< "scale=2; $energy / $power")
|
||||
hours_int=$(${pkgs.bc}/bin/bc <<< "scale=0; $hours / 1")
|
||||
minutes=$(${pkgs.bc}/bin/bc <<< "scale=0; 60 * ($hours - $hours_int)/1")
|
||||
|
||||
if [ "$hours_int" -gt "0" ]; then
|
||||
# Show hours and minutes if time remaining is greater than or equal to 1 hour
|
||||
echo "Empty in: $hours_int hours $minutes minutes"
|
||||
else
|
||||
# Show minutes if time remaining is less than 1 hour
|
||||
echo "Empty in: $minutes minutes"
|
||||
fi
|
||||
|
||||
elif [ "$battery_status" == "Full" ]; then
|
||||
echo "Battery full"
|
||||
elif [ "$battery_status" == "Not charging" ]; then
|
||||
echo "Battery full - not charging"
|
||||
fi
|
||||
|
||||
echo "Power consumption: $power_watts W"
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -14,7 +14,7 @@
|
|||
*image*)
|
||||
echo "$(${xclip}/bin/xclip -selection clipboard -t TARGETS -o)"
|
||||
filename=$(${xclip}/bin/xclip -selection clipboard -t image/png -o | ${openssl}/bin/openssl sha1 | cut -b 49-)
|
||||
file_exists=$(/bin/ls $image_location | grep $filename | sed "s/\..*//")
|
||||
file_exists=$(ls $image_location | grep $filename | sed "s/\..*//")
|
||||
[[ $filename != "$file_exists" ]] &&
|
||||
xclip -selection clipboard -t image/png -o > "$image_location/$filename.png" &&
|
||||
notify-send -t 5000 "Image Copied" "$image_location/$filename.png"
|
||||
|
@ -22,7 +22,7 @@
|
|||
*UTF8_STRING*)
|
||||
echo "$(${xclip}/bin/xclip -selection clipboard -t TARGETS -o)"
|
||||
filename=$(${xclip}/bin/xclip -selection clipboard -t UTF8_STRING -o | ${openssl}/bin/openssl sha1 | cut -b 49-)
|
||||
file_exists=$(/bin/ls "$text_location" | grep "$filename" | sed "s/\..*//")
|
||||
file_exists=$(ls "$text_location" | grep "$filename" | sed "s/\..*//")
|
||||
echo "$filename" "$file_exists"
|
||||
[[ "$filename" != "$file_exists" ]] &&
|
||||
xclip -selection clipboard -t UTF8_STRING -o > "$text_location/$filename"
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
(writeShellScriptBin "dmenu-wifi" ''
|
||||
nmcli dev wifi rescan
|
||||
ssid_list=$(nmcli -f in-use,bssid,ssid,mode,chan,freq,rate,signal,bars,security dev wifi)
|
||||
available_connections=$(echo "$ssid_list" | sed '/--.*Infra/d')
|
||||
|
||||
connection=$( echo "$available_connections" | dmenu -l 20)
|
||||
bssid=$(echo "$connection" | sed 's/^.\s*//;s/\s\s.*$//')
|
||||
ssid=$(echo "$connection" | sed 's/^.\s*[0-9;A-Z;:]*\s\s//;s/\s*Infra\s*[0-9].*$//')
|
||||
[[ "$connection" = "" ]] && notify-send -t 5000 "Wifi Connect" "Cancelled" && exit 0
|
||||
[[ $( echo "$connection" | grep "IN-USE" -o) = "IN-USE" ]] && notify-send -t 5000 "Wifi Connect" "Please select valid network" && exit 0
|
||||
[[ -n "$(echo "$connection" | grep '\*')" ]] && notify-send -t 5000 "Wifi Connect" "Already Connected to: $(echo "$ssid")" && exit 0
|
||||
|
||||
notify-send -t 5000 "Network Manager" "Attempting to connect to $ssid..."
|
||||
nmcli connection modify "$ssid" 802-11-wireless.bssid "$bssid"
|
||||
nmcli device wifi connect "$bssid"
|
||||
return_code=$?
|
||||
if [ $return_code == 4 ];
|
||||
then
|
||||
notify-send -t 5000 "Wifi Connect" "Please enter password for '$ssid'..."
|
||||
prompt="Enter Password for '$ssid'"
|
||||
pwd=$(echo "" | dmenu -p "$prompt")
|
||||
nmcli device wifi connect "$bssid" password "$pwd"
|
||||
return_code=$?
|
||||
fi
|
||||
case "$return_code" in
|
||||
0) notify-send -t 5000 "Wifi Connect" "Successfully connected to: $ssid!"
|
||||
pkill -RTMIN+12 dwmblocks
|
||||
exit 0
|
||||
;;
|
||||
3) notify-send -t 5000 "Wifi Connect" "Connection to $ssid failed. Timeout expired?"
|
||||
pkill -RTMIN+12 dwmblocks
|
||||
exit 1
|
||||
;;
|
||||
4)
|
||||
notify-send -t 5000 "Wifi Connect" "Connection to $ssid failed. Possibly wrong password?"
|
||||
nmcli connection delete id "$ssid"
|
||||
pkill -RTMIN+12 dwmblocks
|
||||
exit 1
|
||||
;;
|
||||
*) notify-send -t 5000 "Wifi Connect" "Connection to $ssid failed. Error code $?"
|
||||
echo "Failed. Exiting"
|
||||
pkill -RTMIN+12 dwmblocks
|
||||
exit 1
|
||||
esac
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
(pkgs.writeShellScriptBin "dunstify-battery-notification" ''
|
||||
msgTag="battery-notify"
|
||||
${pkgs.dunst}/bin/dunstify -a "batteryNotify" -u critical -i battery-notify -h string:x-dunst-stack-tag:$msgTag "Battery Status" "$(battery-status)" -t 5000
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
(writeShellScriptBin "sb-battery" ''
|
||||
BAT=/sys/class/power_supply/BAT0/capacity
|
||||
|
||||
# Exit script if no battery detected
|
||||
[ ! -f "$BAT" ] && exit
|
||||
|
||||
STATUS=$(cat /sys/class/power_supply/BAT0/uevent | grep "POWER_SUPPLY_STATUS" | sed "s/^.*=//")
|
||||
capacity=$(cat "$BAT")
|
||||
|
||||
if [ "$STATUS" == "Charging" ] || [ "$STATUS" == "Not charging" ]; then
|
||||
echo "[ $capacity%] "
|
||||
else
|
||||
case $capacity in
|
||||
100) echo "[ $capacity%] ";;
|
||||
9[0-9]) echo "[ $capacity%] ";;
|
||||
8[0-9]) echo "[ $capacity%] ";;
|
||||
7[0-9]) echo "[ $capacity%] ";;
|
||||
6[0-9]) echo "[ $capacity%] ";;
|
||||
5[0-9]) echo "[ $capacity%] ";;
|
||||
4[0-9]) echo "[ $capacity%] ";;
|
||||
3[0-9]) echo "[ $capacity%] ";;
|
||||
2[0-9]) echo "[ $capacity%] ";;
|
||||
1[0-9]) echo "[ $capacity%] ";;
|
||||
[6-9]) echo "[ $capacity%] ";;
|
||||
[0-5]) echo "[ $capacity%] ";;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ $capacity -le 20 && $STATUS != "Charging" ]]; then
|
||||
dunstify-battery-notification
|
||||
fi
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -4,10 +4,10 @@
|
|||
(writeShellScriptBin "sb-updates" ''
|
||||
# Gets number of flake inputs that are ready for update
|
||||
# Checks every 60 minutes
|
||||
inputs=$(cd /etc/nixos &&
|
||||
nix flake update --output-lock-file <(cat flake.nix) 2> /tmp/update &&
|
||||
cat /tmp/update | grep -c Update)
|
||||
printf "[ $inputs] "
|
||||
# inputs=$(cd /etc/nixos &&
|
||||
# nix flake update --output-lock-file <(cat flake.nix) 2> /tmp/update &&
|
||||
# cat /tmp/update | grep -c Update)
|
||||
# printf "[ $inputs] "
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
# TODO add emoji and dmenu-dict scripts
|
||||
# TODO: add emoji and dmenu-dict scripts
|
||||
home.file.".config/sxhkd/sxhkdrc" = {
|
||||
recursive = true;
|
||||
text = ''
|
||||
|
@ -15,26 +15,14 @@
|
|||
XF86AudioMicMute
|
||||
pamixer --default-source --toggle-mute && dunstify-volume-notification && pkill -RTMIN+10 dwmblocks && exit 1
|
||||
|
||||
XF86MonBrightnessUp
|
||||
light -A 5 && dunstify-brightness-notification
|
||||
|
||||
XF86MonBrightnessDown
|
||||
light -U 5 && dunstify-brightness-notification
|
||||
|
||||
XF86Messenger
|
||||
dunstify-battery-notification
|
||||
|
||||
control + Home
|
||||
bookmark-add
|
||||
|
||||
control + Insert
|
||||
bookmark-insert
|
||||
|
||||
control + F8
|
||||
clipboard-image-recall /tmp/clipboard/images/
|
||||
|
||||
Print
|
||||
flameshot gui
|
||||
env QT_AUTO_SCREEN_SCALE_FACTOR=1.5 QT_SCREEN_SCALE_FACTORS="" flameshot gui
|
||||
|
||||
control + F7
|
||||
emoji-picker
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
|
||||
monitor = "${toString (builtins.map (m: "xrandr --output ${ m.name } --mode ${ toString( m.width )}x${ toString( m.height )} --pos ${ toString( m.x)}x${ toString( m.y)}" ) config.monitors)}";
|
||||
in
|
||||
{
|
||||
# TODO configure x11 to look in .config/x11
|
||||
{pkgs, ...}: {
|
||||
# TODO: configure x11 to look in .config/x11
|
||||
home.file.".xinitrc" = {
|
||||
recursive = true;
|
||||
text = ''
|
||||
|
||||
picom -b --config ~/.config/picom/picom.conf
|
||||
xrdb ~/.Xresources
|
||||
|
||||
${monitor}
|
||||
xrdb -merge ~/.Xresources
|
||||
|
||||
autostart="clipboard-save dwmblocks feh-wallpaper-changer sxhkd"
|
||||
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
home.file.".Xresources" = {
|
||||
recursive = true;
|
||||
text = ''
|
||||
! scale
|
||||
Xft.dpi: 144
|
||||
|
||||
! st
|
||||
st.alpha: 0.8
|
||||
St.font: monospace:pixelsize=21:antialias=true:autohint=true;
|
||||
St.font2: NotoColorEmoji:pixelsize=19:antialias=true:autohint=true;
|
||||
|
||||
! dwm
|
||||
dwm.borderpx: 3
|
||||
dwm.font: monospace:size=12
|
||||
dwm.col_base00: #${config.colorScheme.colors.base00}
|
||||
dwm.col_base03: #${config.colorScheme.colors.base03}
|
||||
dwm.col_base04: #${config.colorScheme.colors.base04}
|
||||
dwm.col_base05: #${config.colorScheme.colors.base05}
|
||||
dwm.col_base08: #${config.colorScheme.colors.base08}
|
||||
dwm.col_base0B: #${config.colorScheme.colors.base0B}
|
||||
|
||||
! dmenu
|
||||
dmenu.font: monospace:size=12
|
||||
dmenu.font2: NotoColorEmoji:pixelsize=22:antialias=true:autohint=true
|
||||
dmenu.topbar: 1
|
||||
dmenu.normfgcolor: #${config.colorScheme.colors.base05}
|
||||
dmenu.normbgcolor: #${config.colorScheme.colors.base03}
|
||||
dmenu.selfgcolor: #${config.colorScheme.colors.base00}
|
||||
dmenu.selbgcolor: #${config.colorScheme.colors.base0B}
|
||||
|
||||
Nsxiv.window.background: #${config.colorScheme.colors.base03}
|
||||
Nsxiv.window.foreground: #${config.colorScheme.colors.base05}
|
||||
Nsxiv.mark.foreground: #${config.colorScheme.colors.base08}
|
||||
|
||||
Nsxiv.bar.background: #${config.colorScheme.colors.base00}
|
||||
Nsxiv.bar.foreground: #${config.colorScheme.colors.base05}
|
||||
Nsxiv.bar.font: monospace:size=12
|
||||
|
||||
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
user = config.home.username;
|
||||
in
|
||||
{
|
||||
home.activation.get-notes = lib.hm.dag.entryAfter [ "installPackages" ] ''
|
||||
notes_dir=/home/${user}/.local/share/notes
|
||||
remote=git@git.bitlab21.com:sam/notes
|
||||
if [ -d "$notes_dir" ];
|
||||
then
|
||||
cd "$notes_dir"
|
||||
[ ! -d .git ] && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir"
|
||||
else
|
||||
mkdir -p "$notes_dir" && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir"
|
||||
fi
|
||||
exit 0
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
package = pkgs.yazi;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
settings = {
|
||||
log = {
|
||||
enabled = true;
|
||||
};
|
||||
manager = {
|
||||
show_hidden = false;
|
||||
sort_by = "modified";
|
||||
sort_dir_first = true;
|
||||
sort_reverse = true;
|
||||
};
|
||||
};
|
||||
|
||||
theme = {
|
||||
manager = {
|
||||
marker_copied = { fg = "#98bb6c"; bg = "#98bb6c"; };
|
||||
marker_cut = { fg = "#e46876"; bg = "#e46876"; };
|
||||
marker_marked = { fg = "#957fb8"; bg = "#957fb8"; };
|
||||
marker_selected = { fg = "#ffa066"; bg = "#ffa066"; };
|
||||
cwd = { fg = "#e6c384"; };
|
||||
hovered = { reversed = true; };
|
||||
preview_hovered = { reversed = true; };
|
||||
tab_active = { reversed = true; };
|
||||
tab_inactive = { };
|
||||
tab_width = 1;
|
||||
count_copied = { fg = "#1f1f28"; bg = "#98bb6c"; };
|
||||
count_cut = { fg = "#1f1f28"; bg = "#e46876"; };
|
||||
count_selected = { fg = "#1f1f28"; bg = "#e6c384"; };
|
||||
border_symbol = "│";
|
||||
border_style = { fg = "#dcd7ba"; };
|
||||
};
|
||||
|
||||
status = {
|
||||
separator_open = "";
|
||||
separator_close = "";
|
||||
separator_style = { fg = "reset"; bg = "#363646"; };
|
||||
mode_normal = { fg = "#1f1f28"; bg = "#85a6ea"; bold = true; };
|
||||
mode_select = { fg = "#1f1f28"; bg = "#957fb8"; bold = true; };
|
||||
mode_unset = { fg = "#1f1f28"; bg = "#e6c384"; bold = true; };
|
||||
progress_label = { fg = "#85a6ea"; bg = "#363646"; bold = true; };
|
||||
progress_normal = { fg = "#363646"; bg = "#1f1f28"; };
|
||||
progress_error = { fg = "#363646"; bg = "#1f1f28"; };
|
||||
permissions_t = { fg = "#98bb6c"; };
|
||||
permissions_r = { fg = "#e6c384"; };
|
||||
permissions_w = { fg = "#e82424"; };
|
||||
permissions_x = { fg = "#7aa89f"; };
|
||||
permissions_s = { fg = "#938aa9"; };
|
||||
};
|
||||
|
||||
select = {
|
||||
border = { fg = "#7fb4ca"; };
|
||||
active = { fg = "#938aa9"; bold = true; };
|
||||
inactive = { };
|
||||
};
|
||||
|
||||
input = {
|
||||
border = { fg = "#7fb4ca"; };
|
||||
title = { };
|
||||
value = { };
|
||||
selected = { reversed = true; };
|
||||
};
|
||||
|
||||
completion = {
|
||||
border = { fg = "#7fb4ca"; };
|
||||
active = { reversed = true; };
|
||||
inactive = { };
|
||||
};
|
||||
|
||||
tasks = {
|
||||
border = { fg = "#7fb4ca"; };
|
||||
title = { };
|
||||
hovered = { fg = "#938aa9"; };
|
||||
};
|
||||
|
||||
which = {
|
||||
cols = 2;
|
||||
separator = " - ";
|
||||
separator_style = { fg = "#727169"; };
|
||||
mask = { bg = "#16161d"; };
|
||||
rest = { fg = "#727169"; };
|
||||
cand = { fg = "#85a6ea"; };
|
||||
desc = { fg = "#565666"; };
|
||||
};
|
||||
|
||||
help = {
|
||||
on = { fg = "#7aa89f"; };
|
||||
run = { fg = "#938aa9"; };
|
||||
desc = { };
|
||||
hovered = { reversed = true; bold = true; };
|
||||
footer = { fg = "#090618"; bg = "#dcd7ba"; };
|
||||
};
|
||||
|
||||
notify = {
|
||||
title_info = { fg = "#98bb6c"; };
|
||||
title_warn = { fg = "#e6c384"; };
|
||||
title_error = { fg = "#e82424"; };
|
||||
};
|
||||
|
||||
filetype = {
|
||||
rules = [
|
||||
{ mime = "image/*"; fg = "#e6c384"; }
|
||||
{ mime = "{audio,video}/*"; fg = "#957fb8"; }
|
||||
{ mime = "application/{,g}zip"; fg = "#e46876"; }
|
||||
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}"; fg = "#e46876"; }
|
||||
{ mime = "application/{pdf,doc,rtf,vnd.*}"; fg = "#6a9589"; }
|
||||
{ name = "*"; is = "orphan"; fg = "#e46876"; }
|
||||
{ name = "*"; is = "exec"; fg = "#957fb8"; }
|
||||
{ name = "*/"; fg = "#85a6ea"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,7 @@
|
|||
{ ...
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Import users
|
||||
|
@ -12,28 +15,8 @@
|
|||
./common/optional/syncthing.nix
|
||||
./common/optional/desktop/dwm
|
||||
./common/optional/desktop/common/themes/standard-dark.nix
|
||||
|
||||
];
|
||||
# ------
|
||||
# | DP-1
|
||||
# ------
|
||||
monitors = [
|
||||
{
|
||||
name = "DP-1";
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
x = 0;
|
||||
y = 0;
|
||||
workspace = "1";
|
||||
primary = true;
|
||||
}
|
||||
{
|
||||
name = "DP-2";
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
x = 2560;
|
||||
y = 0;
|
||||
}
|
||||
./common/optional/notes.nix
|
||||
./common/optional/yazi.nix
|
||||
];
|
||||
|
||||
colorScheme = {
|
||||
|
@ -60,4 +43,37 @@
|
|||
};
|
||||
};
|
||||
|
||||
xresources.extraConfig = ''
|
||||
! st
|
||||
st.alpha: 0.8
|
||||
St.font: monospace:pixelsize=21:antialias=true:autohint=true;
|
||||
St.font2: NotoColorEmoji:pixelsize=19:antialias=true:autohint=true;
|
||||
|
||||
! dwm
|
||||
dwm.borderpx: 3
|
||||
dwm.font: monospace:size=12
|
||||
dwm.col_base00: #${config.colorScheme.colors.base00}
|
||||
dwm.col_base03: #${config.colorScheme.colors.base03}
|
||||
dwm.col_base04: #${config.colorScheme.colors.base04}
|
||||
dwm.col_base05: #${config.colorScheme.colors.base05}
|
||||
dwm.col_base08: #${config.colorScheme.colors.base08}
|
||||
dwm.col_base0B: #${config.colorScheme.colors.base0B}
|
||||
|
||||
! dmenu
|
||||
dmenu.font: monospace:size=12
|
||||
dmenu.font2: NotoColorEmoji:pixelsize=22:antialias=true:autohint=true
|
||||
dmenu.topbar: 1
|
||||
dmenu.normfgcolor: #${config.colorScheme.colors.base05}
|
||||
dmenu.normbgcolor: #${config.colorScheme.colors.base03}
|
||||
dmenu.selfgcolor: #${config.colorScheme.colors.base00}
|
||||
dmenu.selbgcolor: #${config.colorScheme.colors.base0B}
|
||||
|
||||
Nsxiv.window.background: #${config.colorScheme.colors.base03}
|
||||
Nsxiv.window.foreground: #${config.colorScheme.colors.base05}
|
||||
Nsxiv.mark.foreground: #${config.colorScheme.colors.base08}
|
||||
|
||||
Nsxiv.bar.background: #${config.colorScheme.colors.base00}
|
||||
Nsxiv.bar.foreground: #${config.colorScheme.colors.base05}
|
||||
Nsxiv.bar.font: monospace:size=12
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{ outputs, ... }:
|
||||
|
||||
{
|
||||
{outputs, ...}: {
|
||||
home.username = "sam";
|
||||
home.homeDirectory = "/home/sam";
|
||||
|
||||
imports = [
|
||||
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
|
||||
imports =
|
||||
[
|
||||
]
|
||||
++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
@ -17,9 +17,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
home.sessionPath = [
|
||||
];
|
||||
|
||||
xdg.userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
|
@ -39,6 +36,6 @@
|
|||
READER = "zathura";
|
||||
IMAGE_VIEWER = "nsxiv";
|
||||
IMAGE_EDITOR = "drawing";
|
||||
PATH = "$PATH:$HOME/.scripts";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
# Disko setup
|
||||
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
|
||||
dev = "/dev/nvme0n1"; # depends on target hardware
|
||||
encrypted = true; # currrently only applies to btrfs
|
||||
btrfsMountDevice =
|
||||
if encrypted
|
||||
then "/dev/mapper/crypted"
|
||||
else "/dev/root_vg/root";
|
||||
user = "sam";
|
||||
impermanence = true;
|
||||
in {
|
||||
imports = [
|
||||
# Create users for this host
|
||||
../common/users/${user}
|
||||
|
||||
# Disk configuration
|
||||
inputs.disko.nixosModules.disko
|
||||
(import ../common/disks {
|
||||
device = dev;
|
||||
impermanence = impermanence;
|
||||
fsType = fsType;
|
||||
encrypted = encrypted;
|
||||
})
|
||||
|
||||
# Impermanence
|
||||
(import ../common/disks/btrfs/impermanence.nix {
|
||||
btrfsMountDevice = btrfsMountDevice;
|
||||
lib = lib;
|
||||
})
|
||||
|
||||
# Import core options
|
||||
./hardware-configuration.nix
|
||||
../common/core
|
||||
|
||||
# Import optional options
|
||||
../common/optional/persistence.nix
|
||||
../common/optional/pipewire.nix
|
||||
../common/optional/openssh.nix
|
||||
../common/optional/dwm.nix
|
||||
../common/optional/nfs-mounts/media.nix
|
||||
../common/optional/nfs-mounts/homeshare.nix
|
||||
../common/optional/nfs-mounts/photos.nix
|
||||
../common/optional/printing.nix
|
||||
../common/optional/backlight.nix
|
||||
../common/optional/xmodmap-arrow-remaps.nix
|
||||
];
|
||||
|
||||
boot = {
|
||||
blacklistedKernelModules = ["snd_hda_intel" "snd_soc_skl"];
|
||||
kernelModules = ["iwlwifi"];
|
||||
initrd.kernelModules = ["thinkpad-acpi" "acpi-call"];
|
||||
kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest;
|
||||
extraModulePackages = [
|
||||
config.boot.kernelPackages.acpi_call
|
||||
];
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 3;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
libinput.touchpad.accelSpeed = "0.5";
|
||||
xserver = {
|
||||
xkb.options = "caps:swapescape";
|
||||
dpi = 196;
|
||||
upscaleDefaultCursor = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment.variables = {
|
||||
GDK_SCALE = "2.2";
|
||||
GDK_DPI_SCALE = "0.8";
|
||||
_JAVA_OPTIONS = "-Dsun.java2d.uiScale=2.2";
|
||||
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||
XCURSOR_SIZE = "64";
|
||||
};
|
||||
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "ondemand";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
|
||||
START_CHARGE_THRESH_BAT0 = 50;
|
||||
STOP_CHARGE_THRESH_BAT0 = 95;
|
||||
};
|
||||
};
|
||||
|
||||
hardware = {
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
enableRedistributableFirmware = true;
|
||||
firmware = [
|
||||
pkgs.sof-firmware
|
||||
];
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "citadel";
|
||||
networkmanager.enable = true;
|
||||
enableIPv6 = false;
|
||||
nameservers = ["10.0.10.60" "8.8.8.8"];
|
||||
};
|
||||
|
||||
services.libinput.enable = true;
|
||||
}
|
|
@ -8,18 +8,11 @@
|
|||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/9bed98b2-5ee2-4408-a9b1-6d40e9b68135";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
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
|
|
@ -21,6 +21,9 @@ in
|
|||
};
|
||||
secrets = {
|
||||
"passwords/root".neededForUsers = true;
|
||||
"ssh_keys/deploy_key/id_ed25519" = {
|
||||
path = "/etc/ssh/deploy_key-ssh-ed25519";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.brightnessctl
|
||||
];
|
||||
services.illum.enable = true;
|
||||
}
|
|
@ -1,52 +1,7 @@
|
|||
{ pkgs, lib, inputs, config, ... }:
|
||||
let
|
||||
admin_dbPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."software/postgres/admin_db/password".path;
|
||||
customEntryPointScript = pkgs.writeScript "custom-entrypoint.sh" ''
|
||||
#!/usr/bin/env bash
|
||||
## copied from: https://github.com/docker-library/postgres/pull/496#issue-358838955
|
||||
set -Eeo pipefail
|
||||
|
||||
echo "🐘 custom-entry-point"
|
||||
# Example using the functions of the postgres entrypoint to customize startup to always run files in /always-initdb.d/
|
||||
|
||||
source "$(which docker-entrypoint.sh)"
|
||||
|
||||
docker_setup_env
|
||||
docker_create_db_directories
|
||||
# assumption: we are already running as the owner of PGDATA
|
||||
|
||||
# This is needed if the container is started as `root`
|
||||
#if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
if [ "$(id -u)" = '0' ]; then
|
||||
exec gosu postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
|
||||
echo "🐘 db is missing"
|
||||
docker_verify_minimum_env
|
||||
docker_init_database_dir
|
||||
pg_setup_hba_conf
|
||||
|
||||
# only required for '--auth[-local]=md5' on POSTGRES_INITDB_ARGS
|
||||
export PGPASSWORD="''${PGPASSWORD:-$POSTGRES_PASSWORD}"
|
||||
|
||||
docker_temp_server_start "$@" -c max_locks_per_transaction=256
|
||||
docker_setup_db
|
||||
docker_process_init_files /docker-entrypoint-initdb.d/*
|
||||
docker_temp_server_stop
|
||||
else
|
||||
echo "🐘 db already exists"
|
||||
docker_temp_server_start "$@"
|
||||
docker_process_init_files /always-initdb.d/*
|
||||
docker_temp_server_stop
|
||||
fi
|
||||
|
||||
echo "🐘 .. starting!"
|
||||
exec postgres "$@"
|
||||
'';
|
||||
|
||||
initScript = pkgs.writeScript "init.sh" ''
|
||||
initScript = pkgs.writeText "init.sh" ''
|
||||
#!/bin/bash
|
||||
function create_user_and_database() {
|
||||
local database=$1
|
||||
|
@ -83,6 +38,35 @@ let
|
|||
fi
|
||||
'';
|
||||
|
||||
pg_hbaConfig = pkgs.writeText "pg_hba.conf" ''
|
||||
none
|
||||
'';
|
||||
|
||||
pgsqlConfig = pkgs.writeText "postgresql.conf" ''
|
||||
listen_addresses = '*'
|
||||
port = 5432
|
||||
max_connections = 100
|
||||
shared_buffers = 24GB
|
||||
work_mem = 1GB
|
||||
maintenance_work_mem = 10GB
|
||||
autovacuum_work_mem = 2GB
|
||||
dynamic_shared_memory_type = posix
|
||||
wal_level = minimal
|
||||
checkpoint_timeout = 60min
|
||||
checkpoint_completion_target = 0.9
|
||||
max_wal_size = 10GB
|
||||
min_wal_size = 80MB
|
||||
max_wal_senders = 0
|
||||
random_page_cost = 1.0
|
||||
effective_cache_size = 25GB
|
||||
jit = off
|
||||
log_line_prefix = '%m [%p] %q%u@%d '
|
||||
log_timezone = 'Etc/UTC'
|
||||
cluster_name = 'postgres-docker'
|
||||
datestyle = 'iso, dmy'
|
||||
timezone = 'Etc/UTC'
|
||||
default_text_search_config = 'pg_catalog.english'
|
||||
'';
|
||||
in
|
||||
{
|
||||
sops.secrets = {
|
||||
|
@ -94,7 +78,7 @@ in
|
|||
"db".settings.services."db".service = {
|
||||
restart = "unless-stopped";
|
||||
build.context = "/nix/store";
|
||||
build.dockerfile = builtins.baseNameOf "${pkgs.writeScript "pgDockerfile" ''
|
||||
build.dockerfile = builtins.baseNameOf "${pkgs.writeText "pgDockerfile" ''
|
||||
FROM postgres:16
|
||||
# install packages
|
||||
RUN apt-get update \
|
||||
|
@ -102,12 +86,8 @@ in
|
|||
postgresql-16-postgis \
|
||||
jq \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN mkdir -p /scripts/ /always-initdb.d/
|
||||
COPY ${builtins.baseNameOf customEntryPointScript} /scripts/custom-entrypoint.sh
|
||||
RUN chmod -R a+x /scripts
|
||||
ENTRYPOINT /scripts/custom-entrypoint.sh
|
||||
''}";
|
||||
|
||||
command = [ "postgres" "-c" "config_file=/etc/postgresql/postgresql.conf" ];
|
||||
environment = {
|
||||
POSTGRES_PASSWORD_FILE = admin_dbPasswordFile;
|
||||
POSTGRES_USER = "admin";
|
||||
|
@ -135,26 +115,26 @@ in
|
|||
"user": "dbt",
|
||||
"extensions": []
|
||||
}
|
||||
"test": {
|
||||
"user": "test",
|
||||
"extensions": [hstore]
|
||||
}
|
||||
}
|
||||
]
|
||||
'';
|
||||
|
||||
};
|
||||
ports = [ "5432:5432" ];
|
||||
|
||||
volumes = [
|
||||
|
||||
# Mount pgdata to external zfs volume
|
||||
"/mnt/postgres:/var/lib/postgresql/data"
|
||||
|
||||
# Mount config files
|
||||
# "${pg_hbaConfig}:/var/lib/postgres/data/pgdata/pg_hba.conf"
|
||||
"${pgsqlConfig}:/etc/postgresql/postgresql.conf"
|
||||
|
||||
# Need to mount secret file
|
||||
"${admin_dbPasswordFile}:${admin_dbPasswordFile}"
|
||||
|
||||
# PG init script to parse json specified in POSTGRES_MULTIPLE_DATABASES
|
||||
# creates databases, users and installs extensions for each database.
|
||||
"${initScript}:/always-initdb.d/init.sh"
|
||||
"${initScript}:/docker-entrypoint-initdb.d/init.sh"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
services = {
|
||||
libinput.enable = true;
|
||||
xserver = {
|
||||
autoRepeatDelay = 250;
|
||||
autoRepeatInterval = 30;
|
||||
autoRepeatDelay = 300;
|
||||
autoRepeatInterval = 15;
|
||||
enable = true;
|
||||
xkb.layout = "gb";
|
||||
displayManager.startx.enable = true;
|
||||
|
@ -12,12 +12,11 @@
|
|||
windowManager.dwm = {
|
||||
enable = true;
|
||||
package = pkgs.dwm.overrideAttrs {
|
||||
src = pkgs.fetchFromGitea {
|
||||
domain = "git.bitlab21.com";
|
||||
owner = "sam";
|
||||
repo = "dwm";
|
||||
rev = "ee95ad6795dc51217008363e56fe313d1cfdbaf4";
|
||||
sha256 = "sha256-L+TAv0g9VhvM+O5gpbKoCk5fCsktWzjQCa2JkN0Xjt4=";
|
||||
#src = /home/sam/.local/share/src/dwm;
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://git.bitlab21.com/sam/dwm";
|
||||
rev = "49dd30c0d9970ce480ada51dfcaac1a071804c64";
|
||||
sha256 = "0ywca25a1pdjvb4cgv5gx36x3yd6922pqvn9a5f60lcn5fv2a96n";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
fileSystems."/media/homeshare" = {
|
||||
device = "10.0.10.30:/mnt/homeshare";
|
||||
fsType = "nfs";
|
||||
options = [ "noatime" "_netdev" ];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
fileSystems."/media/media" = {
|
||||
device = "10.0.10.30:/mnt/media";
|
||||
fsType = "nfs";
|
||||
options = ["noatime" "_netdev"];
|
||||
};
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
fileSystems."/media/music" = {
|
||||
device = "10.0.10.30:/mnt/media/music";
|
||||
fsType = "nfs";
|
||||
options = [ "noatime" "_netdev" ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
fileSystems."/media/photos" = {
|
||||
device = "10.0.10.30:/mnt/photos";
|
||||
fsType = "nfs";
|
||||
options = [ "noatime" "_netdev" "ro" ];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
{pkgs, ...}: {
|
||||
services = {
|
||||
udev.packages = [pkgs.sane-airscan];
|
||||
printing = {
|
||||
enable = true;
|
||||
drivers = [pkgs.gutenprint pkgs.hplip];
|
||||
};
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
|
||||
hardware = {
|
||||
sane = {
|
||||
enable = true;
|
||||
extraBackends = [pkgs.sane-airscan];
|
||||
netConf = "10.0.10.2";
|
||||
};
|
||||
printers = {
|
||||
ensurePrinters = [
|
||||
{
|
||||
name = "HP_ENVY_6000";
|
||||
description = "Network printer hosted on bob";
|
||||
location = "bob";
|
||||
deviceUri = "ipp://bob/printers/HP_ENVY_6000_series";
|
||||
model = "everywhere";
|
||||
ppdOptions = {
|
||||
PageSize = "A4";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: let
|
||||
customLayout = pkgs.writeText "xkb-layout" ''
|
||||
keycode 64 = Mode_switch
|
||||
keycode 43 = h H Left H
|
||||
keycode 44 = j J Down J
|
||||
keycode 45 = k K Up K
|
||||
keycode 46 = l L Right L
|
||||
'';
|
||||
in {
|
||||
# Remap Alt_L +[hjkl] to left down up right
|
||||
services.xserver.displayManager.sessionCommands = "sleep 5 && ${pkgs.xorg.xmodmap}/bin/xmodmap ${customLayout}";
|
||||
}
|
|
@ -1,22 +1,26 @@
|
|||
{ pkgs, inputs, config, lib, ... }:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
username = "media";
|
||||
pubKeys = lib.filesystem.listFilesRecursive (../keys);
|
||||
pubKeys = lib.filesystem.listFilesRecursive ../keys;
|
||||
hostname = config.networking.hostName;
|
||||
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/${username}".path;
|
||||
secretsDirectory = builtins.toString inputs.nix-secrets;
|
||||
secretsFile = "${secretsDirectory}/secrets.yaml";
|
||||
|
||||
in
|
||||
{
|
||||
in {
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh; # default shell
|
||||
hashedPasswordFile = sopsHashedPasswordFile;
|
||||
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
|
||||
|
||||
extraGroups =
|
||||
[
|
||||
extraGroups = [
|
||||
"scanner"
|
||||
"lp"
|
||||
"wheel"
|
||||
];
|
||||
|
||||
|
@ -65,13 +69,11 @@ in
|
|||
# The containing ssh folders are created as root and if this is the first ~/.ssh/ entry when writing keys,
|
||||
# the ownership is busted and home-manager can't target because it can't write into .ssh...
|
||||
# FIXME: We might not need this depending on how https://github.com/Mic92/sops-nix/issues/381 is fixed
|
||||
system.activationScripts.sopsSetSshOwnwership =
|
||||
let
|
||||
system.activationScripts.sopsSetSshOwnwership = let
|
||||
sshFolder = "/home/${username}/.ssh";
|
||||
user = config.users.users.${username}.name;
|
||||
group = config.users.users.${username}.group;
|
||||
in
|
||||
''
|
||||
in ''
|
||||
mkdir -p ${sshFolder} || true
|
||||
chown -R ${user}:${group} /home/${username}/.ssh
|
||||
'';
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
{ pkgs, inputs, config, lib, ... }:
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hostname = config.networking.hostName;
|
||||
pubKeys = lib.filesystem.listFilesRecursive (../keys);
|
||||
pubKeys = lib.filesystem.listFilesRecursive ../keys;
|
||||
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/sam".path;
|
||||
secretsDirectory = builtins.toString inputs.nix-secrets;
|
||||
secretsFile = "${secretsDirectory}/secrets.yaml";
|
||||
username = "sam";
|
||||
in
|
||||
{
|
||||
in {
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh; # default shell
|
||||
|
@ -16,8 +20,10 @@ in
|
|||
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
"scanner"
|
||||
"lp"
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
|
@ -38,9 +44,15 @@ in
|
|||
"github-access-token" = {
|
||||
mode = "0655";
|
||||
};
|
||||
"software/postgres/btc_models/password" = { };
|
||||
"software/postgres/btc_models/ip" = { };
|
||||
"software/postgres/btc_models/username" = { };
|
||||
"software/postgres/baseddata_models/password" = {};
|
||||
"software/postgres/baseddata_models/ip" = {};
|
||||
"software/postgres/baseddata_models/username" = {};
|
||||
"software/postgres/osm/password" = {};
|
||||
"software/postgres/osm/ip" = {};
|
||||
"software/postgres/osm/username" = {};
|
||||
"software/postgres/bitcoin/password" = {};
|
||||
"software/postgres/bitcoin/ip" = {};
|
||||
"software/postgres/bitcoin/username" = {};
|
||||
"software/zotero/username" = {};
|
||||
"software/zotero/password" = {};
|
||||
"software/zotero/guid" = {};
|
||||
|
@ -49,7 +61,7 @@ in
|
|||
# Setup software specific templates for user
|
||||
# Should be part of home-manager - waiting for templates functionality
|
||||
# See here https://github.com/Mic92/sops-nix/issues/423 and here https://github.com/Mic92/sops-nix/issues/498
|
||||
# TODO migrate db_ui connection to home-manager when issue 423 and 498 are resolved in github:Mic92/sops-nix
|
||||
# TODO: migrate db_ui connection to home-manager when issue 423 and 498 are resolved in github:Mic92/sops-nix
|
||||
sops.templates."dbui_connections.json" = {
|
||||
path = "/home/${username}/.local/share/db_ui/connections.json";
|
||||
owner = "${username}";
|
||||
|
@ -57,12 +69,20 @@ in
|
|||
content = ''
|
||||
[
|
||||
{
|
||||
"url": "postgresql://${config.sops.placeholder."software/postgres/btc_models/username"}:${config.sops.placeholder."software/postgres/btc_models/password"}@${config.sops.placeholder."software/postgres/btc_models/ip"}/btc_models",
|
||||
"name": "btc_models"
|
||||
"url": "postgresql://${config.sops.placeholder."software/postgres/baseddata_models/username"}:${config.sops.placeholder."software/postgres/baseddata_models/password"}@${config.sops.placeholder."software/postgres/baseddata_models/ip"}/btc_models",
|
||||
"name": "baseddata_models"
|
||||
},
|
||||
{
|
||||
"url": "postgresql://${config.sops.placeholder."software/postgres/btc_models/username"}:${config.sops.placeholder."software/postgres/btc_models/password"}@${config.sops.placeholder."software/postgres/btc_models/ip"}/dev_btc_models",
|
||||
"name": "dev_btc_models"
|
||||
"url": "postgresql://${config.sops.placeholder."software/postgres/baseddata_models/username"}:${config.sops.placeholder."software/postgres/baseddata_models/password"}@${config.sops.placeholder."software/postgres/baseddata_models/ip"}/dev_baseddata_models",
|
||||
"name": "dev_baseddata_models"
|
||||
},
|
||||
{
|
||||
"url": "postgresql://${config.sops.placeholder."software/postgres/osm/username"}:${config.sops.placeholder."software/postgres/osm/password"}@${config.sops.placeholder."software/postgres/osm/ip"}/osm",
|
||||
"name": "osm"
|
||||
},
|
||||
{
|
||||
"url": "postgresql://${config.sops.placeholder."software/postgres/bitcoin/username"}:${config.sops.placeholder."software/postgres/bitcoin/password"}@${config.sops.placeholder."software/postgres/bitcoin/ip"}/bitcoin",
|
||||
"name": "bitcoin"
|
||||
}
|
||||
]
|
||||
'';
|
||||
|
@ -73,27 +93,27 @@ in
|
|||
owner = "${username}";
|
||||
mode = "0600";
|
||||
content = ''
|
||||
bitcoin:
|
||||
baseddata:
|
||||
target: dev
|
||||
outputs:
|
||||
dev:
|
||||
dbname: dev_btc_models
|
||||
host: ${config.sops.placeholder."software/postgres/btc_models/ip"}
|
||||
pass: '${config.sops.placeholder."software/postgres/btc_models/password"}'
|
||||
dbname: dev_baseddata_models
|
||||
host: ${config.sops.placeholder."software/postgres/baseddata_models/ip"}
|
||||
pass: '${config.sops.placeholder."software/postgres/baseddata_models/password"}'
|
||||
port: 5432
|
||||
schema: models
|
||||
threads: 6
|
||||
type: postgres
|
||||
user: ${config.sops.placeholder."software/postgres/btc_models/username"}
|
||||
user: ${config.sops.placeholder."software/postgres/baseddata_models/username"}
|
||||
prod:
|
||||
dbname: btc_models
|
||||
host: ${config.sops.placeholder."software/postgres/btc_models/ip"}
|
||||
pass: '${config.sops.placeholder."software/postgres/btc_models/password"}'
|
||||
dbname: baseddata_models
|
||||
host: ${config.sops.placeholder."software/postgres/baseddata_models/ip"}
|
||||
pass: '${config.sops.placeholder."software/postgres/baseddata_models/password"}'
|
||||
port: 5432
|
||||
schema: models
|
||||
threads: 6
|
||||
type: postgres
|
||||
user: ${config.sops.placeholder."software/postgres/btc_models/username"}
|
||||
user: ${config.sops.placeholder."software/postgres/baseddata_models/username"}
|
||||
|
||||
'';
|
||||
};
|
||||
|
@ -107,13 +127,11 @@ in
|
|||
# The containing folders are created as root and if this is the first entry when writing files,
|
||||
# the ownership is busted and home-manager can't target because it can't write to these dirs...
|
||||
# FIXME: We might not need this depending on how https://github.com/Mic92/sops-nix/issues/381 is fixed
|
||||
system.activationScripts.sopsSetOwnwership =
|
||||
let
|
||||
system.activationScripts.sopsSetOwnwership = let
|
||||
sshFolder = "/home/${username}/.ssh";
|
||||
user = config.users.users.${username}.name;
|
||||
group = config.users.users.${username}.group;
|
||||
in
|
||||
''
|
||||
in ''
|
||||
mkdir -p ${sshFolder} || true
|
||||
chown -R ${user}:${group} /home/${username}/.ssh
|
||||
'';
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
{ inputs, config, lib, pkgs, outputs, configLib, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
# Import core options
|
||||
./hardware-configuration.nix
|
||||
../common/core
|
||||
|
||||
# Import optional options
|
||||
../common/optional/openssh
|
||||
../common/optional/fileserver-nfs-mount.nix
|
||||
|
||||
# Create users for this host
|
||||
../common/users/admin
|
||||
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.modifications
|
||||
outputs.overlays.unstable-packages
|
||||
];
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
||||
networking = {
|
||||
hostName = "fileserver";
|
||||
networkmanager.enable = true;
|
||||
enableIPv6 = false;
|
||||
hosts = { "192.168.122.223" = [ "fileserver" ]; };
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/London";
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
{ inputs, config, lib, pkgs, outputs,... }:
|
||||
let
|
||||
dev = "/dev/vda";
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[
|
||||
# Import core options
|
||||
./hardware-configuration.nix
|
||||
../common/core
|
||||
|
||||
# Import optional options
|
||||
../common/optional/pipewire.nix
|
||||
../common/optional/hyprland.nix
|
||||
../common/optional/displayManager/sddm.nix
|
||||
../common/optional/openssh.nix
|
||||
|
||||
# Create users for this host
|
||||
../common/users/sam
|
||||
|
||||
];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "${dev}";
|
||||
|
||||
networking = {
|
||||
hostName = "nixdev";
|
||||
networkmanager.enable = true;
|
||||
enableIPv6 = false;
|
||||
};
|
||||
|
||||
services.libinput.enable = true;
|
||||
}
|
||||
|
|
@ -1,33 +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 + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/f9abe09a-de68-4913-b6c5-ad55b473a961";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/fe24d2ba-2fbc-4ef5-8139-a26f4fc3f3e3"; }
|
||||
];
|
||||
|
||||
# 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.enp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
|
@ -1,25 +1,38 @@
|
|||
{ inputs, config, lib, pkgs, outputs, ... }:
|
||||
let
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
# Disko setup
|
||||
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
|
||||
dev = "/dev/nvme0n1"; # depends on target hardware
|
||||
encrypted = true; # currrently only applies to btrfs
|
||||
btrfsMountDevice = if encrypted then "/dev/mapper/crypted" else "/dev/root_vg/root";
|
||||
btrfsMountDevice =
|
||||
if encrypted
|
||||
then "/dev/mapper/crypted"
|
||||
else "/dev/root_vg/root";
|
||||
user = "sam";
|
||||
impermanence = true;
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[
|
||||
in {
|
||||
imports = [
|
||||
# Create users for this host
|
||||
../common/users/${user}
|
||||
|
||||
# Disk configuration
|
||||
inputs.disko.nixosModules.disko
|
||||
(import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; })
|
||||
(import ../common/disks {
|
||||
device = dev;
|
||||
impermanence = impermanence;
|
||||
fsType = fsType;
|
||||
encrypted = encrypted;
|
||||
})
|
||||
|
||||
# Impermanence
|
||||
(import ../common/disks/btrfs/impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
|
||||
(import ../common/disks/btrfs/impermanence.nix {
|
||||
btrfsMountDevice = btrfsMountDevice;
|
||||
lib = lib;
|
||||
})
|
||||
|
||||
# Import core options
|
||||
./hardware-configuration.nix
|
||||
|
@ -30,8 +43,9 @@ in
|
|||
../common/optional/pipewire.nix
|
||||
../common/optional/openssh.nix
|
||||
../common/optional/dwm.nix
|
||||
../common/optional/nfs-mounts/music.nix
|
||||
|
||||
../common/optional/nfs-mounts/media.nix
|
||||
../common/optional/nfs-mounts/homeshare.nix
|
||||
../common/optional/printing.nix
|
||||
];
|
||||
|
||||
boot = {
|
||||
|
@ -44,6 +58,21 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
xserver = {
|
||||
dpi = 144;
|
||||
upscaleDefaultCursor = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment.variables = {
|
||||
GDK_SCALE = "2";
|
||||
GDK_DPI_SCALE = "0.6";
|
||||
_JAVA_OPTIONS = "-Dsun.java2d.uiScale=1.8";
|
||||
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||
XCURSOR_SIZE = "32";
|
||||
};
|
||||
|
||||
hardware.firmware = [
|
||||
pkgs.sof-firmware
|
||||
];
|
||||
|
@ -52,6 +81,7 @@ in
|
|||
hostName = "semita";
|
||||
networkmanager.enable = true;
|
||||
enableIPv6 = false;
|
||||
nameservers = ["10.0.10.60" "8.8.8.8"];
|
||||
};
|
||||
|
||||
services.libinput.enable = true;
|
||||
|
|
|
@ -27,7 +27,9 @@ in
|
|||
# Import optional options
|
||||
../common/optional/openssh.nix
|
||||
../common/optional/persistence.nix
|
||||
../common/optional/nfs-mounts/media.nix
|
||||
../common/optional/gaming.nix
|
||||
../common/optional/printing.nix
|
||||
|
||||
];
|
||||
|
||||
|
|
4
justfile
4
justfile
|
@ -1,4 +1,4 @@
|
|||
SOPS_FILE := "../nix-secrets/secrets.yaml"
|
||||
SOPS_FILE := "~/.local/share/src/nix-secrets/secrets.yaml"
|
||||
|
||||
# default recipe to display help information
|
||||
default:
|
||||
|
@ -26,7 +26,7 @@ edit-sops:
|
|||
|
||||
# update keys in secrets.yaml and push to remote
|
||||
update-sops-secrets:
|
||||
cd ../nix-secrets && (\
|
||||
cd ~/.local/share/src/nix-secrets && (\
|
||||
nix-shell -p sops --run "sops updatekeys -y secrets.yaml" && \
|
||||
git add -u && (git commit -m "updated secrets" || true) && git push \
|
||||
)
|
||||
|
|
|
@ -2,14 +2,17 @@
|
|||
, fetchurl ? pkgs.fetchurl
|
||||
, buildPythonPackage ? pkgs.python311Packages.buildPythonPackage
|
||||
}:
|
||||
let
|
||||
version = "0.21.4"; # this needs to be fetched from github to get the latest
|
||||
in
|
||||
buildPythonPackage {
|
||||
pname = "shandy-sqlfmt";
|
||||
version = "0.21.3";
|
||||
format = "wheel";
|
||||
version = version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/tconbeer/sqlfmt/releases/download/v0.21.3/shandy_sqlfmt-0.21.3-py3-none-any.whl";
|
||||
sha256 = "sha256-gb/gLAcGD7F/0LL6WllfX1CW4Tug//jNDA0v9O5tedA=";
|
||||
url = "https://github.com/tconbeer/sqlfmt/releases/download/v${version}/shandy_sqlfmt-${version}-py3-none-any.whl";
|
||||
sha256 = "sha256-mS8afZtQxN/blaVgG2cBD/wnRZGxAwQWPJqtTji1IJk=";
|
||||
};
|
||||
|
||||
doCheck = false;
|
||||
|
|
|
@ -45,7 +45,7 @@ echo "Creating '$hostname' ssh keys"
|
|||
ssh-keygen -t ed25519 -f "$temp$persist/etc/ssh/ssh_host_ed25519_key" -C root@"$hostname" -N ""
|
||||
|
||||
# Extract luks key from secrets
|
||||
luks_secret=$(nix-shell -p sops --run "SOPS_AGE_KEY_FILE=~/.config/sops/age/keys.txt sops -d --extract '[""\"luks_passphrase""\"][""\"$hostname""\"]' ../nix-secrets/secrets.yaml")
|
||||
luks_secret=$(nix-shell -p sops --run "SOPS_AGE_KEY_FILE=~/.config/sops/age/keys.txt sops -d --extract '[""\"luks_passphrase""\"][""\"$hostname""\"]' ~/.local/share/src/nix-secrets/secrets.yaml")
|
||||
echo "$luks_secret" > /tmp/luks_secret.key
|
||||
|
||||
# Generate age key from target host and user public ssh key
|
||||
|
@ -54,7 +54,7 @@ HOST_AGE_KEY=$(nix-shell -p ssh-to-age --run "cat $temp$persist/etc/ssh/ssh_host
|
|||
echo -e "Host age key:\n$HOST_AGE_KEY\n"
|
||||
|
||||
# Update .sops.yaml with new age key:
|
||||
SOPS_FILE="../nix-secrets/.sops.yaml"
|
||||
SOPS_FILE="$HOME/.local/share/src/nix-secrets/.sops.yaml"
|
||||
sed -i "{
|
||||
# Remove any * and & entries for this host
|
||||
/[*&]$hostname/ d;
|
||||
|
@ -63,13 +63,14 @@ sed -i "{
|
|||
/age:/{n; p; s/\(.*- \*\).*/\1$hostname/};
|
||||
# Inject a new hosts: entry
|
||||
/&hosts:/{n; p; s/\(.*- &\).*/\1$hostname $HOST_AGE_KEY/}
|
||||
}" $SOPS_FILE
|
||||
}" "$SOPS_FILE"
|
||||
|
||||
# Commit and push changes to sops file
|
||||
just update-sops-secrets && just update-flake-secrets && just update-flake
|
||||
|
||||
# Copy current nix config over to target
|
||||
cp -prv . "$temp$persist/etc/nixos"
|
||||
echo "copying current nix config to host"
|
||||
cp -pr . "$temp$persist/etc/nixos"
|
||||
|
||||
# Install Nixos to target
|
||||
SHELL=/bin/sh nix run github:nix-community/nixos-anywhere/1.3.0 -- --extra-files "$temp" --disk-encryption-keys /tmp/luks_secret.key /tmp/luks_secret.key --flake .#"$config" root@"$ip" -i "$HOME/.ssh/id_ed25519"
|
||||
|
|
Loading…
Reference in New Issue