2022-11-19 16:14:18 +01:00
|
|
|
{ pkgs, unstable-pkgs, lib, extendedLib, config, inputs, secrets, ... }:
|
2022-04-03 18:03:55 +02:00
|
|
|
let
|
2022-08-16 03:24:06 +02:00
|
|
|
inherit (config) machineVars;
|
2022-04-03 18:03:55 +02:00
|
|
|
in {
|
2024-06-29 14:02:04 +02:00
|
|
|
imports = [
|
2024-08-12 17:36:13 +02:00
|
|
|
./fonts.nix
|
|
|
|
./nix.nix
|
|
|
|
|
|
|
|
./programs/gnupg.nix
|
|
|
|
./programs/neovim.nix
|
|
|
|
./programs/nix-ld.nix
|
|
|
|
./programs/ssh.nix
|
|
|
|
./programs/usbtop.nix
|
|
|
|
|
|
|
|
./services/dbus.nix
|
|
|
|
./services/openssh.nix
|
|
|
|
./services/pcscd.nix
|
|
|
|
./services/pipewire.nix
|
|
|
|
./services/printing.nix
|
|
|
|
./services/resolved.nix
|
|
|
|
./services/smartd.nix
|
|
|
|
./services/systemd-lock-handler.nix
|
|
|
|
./services/xserver.nix
|
2024-06-29 14:02:04 +02:00
|
|
|
];
|
|
|
|
|
2024-06-29 12:46:20 +02:00
|
|
|
sops.defaultSopsFile = ./../.. + "/secrets/${config.networking.hostName}.yaml";
|
2023-03-07 23:08:39 +01:00
|
|
|
|
2022-06-02 16:33:21 +02:00
|
|
|
time.timeZone = "Europe/Oslo";
|
|
|
|
|
|
|
|
console = {
|
|
|
|
font = "Lat2-Terminus16";
|
|
|
|
keyMap = "us";
|
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
useDHCP = false;
|
|
|
|
nameservers = [
|
|
|
|
"1.1.1.1"
|
|
|
|
"8.8.8.8"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-06-25 18:51:18 +02:00
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
2023-07-28 17:59:34 +02:00
|
|
|
|
2022-04-03 18:03:55 +02:00
|
|
|
environment = {
|
|
|
|
variables = {
|
|
|
|
EDITOR = "nvim";
|
|
|
|
VISUAL = "nvim";
|
|
|
|
};
|
|
|
|
|
2022-06-21 01:47:36 +02:00
|
|
|
systemPackages = with pkgs; ([
|
2022-06-12 00:07:40 +02:00
|
|
|
wget
|
2022-06-22 20:16:57 +02:00
|
|
|
] ++ (lib.optionals (!config.machineVars.headless) [
|
2022-06-12 00:07:40 +02:00
|
|
|
haskellPackages.xmobar
|
2022-06-21 01:47:36 +02:00
|
|
|
]));
|
2022-06-12 00:07:40 +02:00
|
|
|
|
2022-04-03 18:03:55 +02:00
|
|
|
shells = with pkgs; [
|
|
|
|
bashInteractive
|
|
|
|
zsh
|
|
|
|
dash
|
|
|
|
];
|
|
|
|
|
|
|
|
etc = {
|
|
|
|
currentSystemPackages = {
|
|
|
|
target = "current-system-packages";
|
|
|
|
text = let
|
|
|
|
inherit (lib.strings) concatStringsSep;
|
|
|
|
inherit (lib.lists) sort;
|
|
|
|
inherit (lib.trivial) lessThan;
|
|
|
|
packages = map (p: "${p.name}") config.environment.systemPackages;
|
|
|
|
sortedUnique = sort lessThan (lib.unique packages);
|
|
|
|
in concatStringsSep "\n" sortedUnique;
|
|
|
|
};
|
|
|
|
};
|
2022-06-02 16:33:21 +02:00
|
|
|
|
2022-11-20 17:12:27 +01:00
|
|
|
shellAliases.fixdisplay = let
|
2022-06-02 16:33:21 +02:00
|
|
|
inherit (config.machineVars) screens headless fixDisplayCommand;
|
2022-08-16 03:24:06 +02:00
|
|
|
|
2022-11-20 17:12:27 +01:00
|
|
|
screenToArgs = name: screen: with screen;
|
|
|
|
"--output ${name} --mode ${resolution} --rate ${toString frequency} --pos ${position}"
|
|
|
|
+ (lib.optionalString primary " --primary");
|
2022-08-16 03:24:06 +02:00
|
|
|
|
2022-06-02 16:33:21 +02:00
|
|
|
screenArgs = lib.concatStringsSep " " (lib.mapAttrsToList screenToArgs screens);
|
2022-08-16 03:24:06 +02:00
|
|
|
|
2022-06-02 16:33:21 +02:00
|
|
|
in lib.mkIf (!headless)
|
2022-11-20 17:12:27 +01:00
|
|
|
(if screenArgs != null
|
2022-08-16 03:24:06 +02:00
|
|
|
then "xrandr ${screenArgs}"
|
|
|
|
else (lib.mkIf (fixDisplayCommand != null) fixDisplayCommand));
|
2022-04-03 18:03:55 +02:00
|
|
|
};
|
|
|
|
|
2022-06-02 16:33:21 +02:00
|
|
|
users = {
|
|
|
|
users.h7x4 = {
|
|
|
|
isNormalUser = true;
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
|
|
|
|
extraGroups = [
|
|
|
|
"audio"
|
2023-01-16 16:06:34 +01:00
|
|
|
"disk"
|
|
|
|
"docker"
|
2022-06-02 16:33:21 +02:00
|
|
|
"input"
|
2023-01-16 16:06:34 +01:00
|
|
|
"libvirtd"
|
2024-08-02 17:45:15 +02:00
|
|
|
"lp"
|
2023-01-16 16:06:34 +01:00
|
|
|
"media"
|
|
|
|
"minecraft"
|
|
|
|
"networkmanager"
|
2024-08-02 17:45:15 +02:00
|
|
|
"scanner"
|
2023-01-16 16:06:34 +01:00
|
|
|
"video"
|
|
|
|
"wheel"
|
2024-06-02 16:30:31 +02:00
|
|
|
"wireshark"
|
2022-06-02 16:33:21 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
groups = {
|
|
|
|
adbusers.members = [ "h7x4" ];
|
|
|
|
};
|
2022-04-03 18:03:55 +02:00
|
|
|
};
|
|
|
|
|
2022-06-12 00:07:40 +02:00
|
|
|
services = {
|
2022-06-21 01:47:36 +02:00
|
|
|
gnome.gnome-keyring.enable = !config.machineVars.headless;
|
2022-06-12 00:07:40 +02:00
|
|
|
|
2022-09-22 04:08:38 +02:00
|
|
|
udev.packages = with pkgs; [
|
|
|
|
yubikey-personalization
|
|
|
|
android-udev-rules
|
2024-06-26 20:32:26 +02:00
|
|
|
light
|
2022-09-22 04:08:38 +02:00
|
|
|
];
|
|
|
|
|
2024-06-02 17:13:29 +02:00
|
|
|
libinput = {
|
|
|
|
enable = !config.machineVars.headless;
|
|
|
|
touchpad.disableWhileTyping = true;
|
|
|
|
};
|
2022-06-12 00:07:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
programs = {
|
2022-06-21 01:47:36 +02:00
|
|
|
dconf.enable = !config.machineVars.headless;
|
2022-06-12 00:07:40 +02:00
|
|
|
git.enable = true;
|
|
|
|
tmux.enable = true;
|
2022-11-20 17:12:27 +01:00
|
|
|
zsh.enable = true;
|
2024-06-29 02:28:20 +02:00
|
|
|
hyprland.enable = true;
|
2022-06-12 00:07:40 +02:00
|
|
|
};
|
|
|
|
|
2022-06-21 01:47:36 +02:00
|
|
|
system.extraDependencies =
|
|
|
|
lib.optionals (config.machineVars.development) (with pkgs; [
|
|
|
|
asciidoc
|
|
|
|
asciidoctor
|
|
|
|
cabal2nix
|
|
|
|
clang
|
|
|
|
dart
|
|
|
|
dotnet-sdk
|
2023-07-28 17:59:34 +02:00
|
|
|
# dotnet-sdk_3
|
|
|
|
# dotnet-sdk_5
|
2022-06-21 01:47:36 +02:00
|
|
|
dotnetPackages.Nuget
|
|
|
|
elm2nix
|
|
|
|
elmPackages.elm
|
|
|
|
flutter
|
|
|
|
gcc
|
|
|
|
ghc
|
|
|
|
ghcid
|
2023-07-28 17:59:34 +02:00
|
|
|
# haskellPackages.Cabal_3_6_3_0
|
2022-06-21 01:47:36 +02:00
|
|
|
maven
|
2024-07-09 11:03:17 +02:00
|
|
|
nixfmt-rfc-style
|
2022-06-21 01:47:36 +02:00
|
|
|
nixpkgs-fmt
|
|
|
|
# nixpkgs-hammering
|
|
|
|
nodePackages.node2nix
|
|
|
|
nodePackages.npm
|
|
|
|
nodePackages.sass
|
|
|
|
nodePackages.typescript
|
|
|
|
nodePackages.yarn
|
|
|
|
nodejs
|
|
|
|
plantuml
|
|
|
|
python3
|
|
|
|
rustc
|
|
|
|
rustc
|
|
|
|
rustup
|
|
|
|
sqlcheck
|
|
|
|
sqlint
|
|
|
|
sqlite
|
|
|
|
sqlite-web
|
|
|
|
]);
|
|
|
|
|
2024-06-26 20:29:25 +02:00
|
|
|
security.rtkit.enable = !config.machineVars.headless;
|
2022-06-12 00:07:40 +02:00
|
|
|
|
2024-06-02 16:29:48 +02:00
|
|
|
security.sudo.extraConfig = let
|
|
|
|
sudoLecture = pkgs.writeText "sudo-lecture.txt" (extendedLib.termColors.front.red "Be careful or something, idk...\n");
|
|
|
|
in ''
|
2022-04-03 18:03:55 +02:00
|
|
|
Defaults lecture = always
|
2024-06-02 16:29:48 +02:00
|
|
|
Defaults lecture_file = ${sudoLecture}
|
2022-04-03 18:03:55 +02:00
|
|
|
'';
|
|
|
|
}
|