kacper inspirerat
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
userName,
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
trusted-users = [
|
||||
"root"
|
||||
"@wheel"
|
||||
];
|
||||
};
|
||||
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 14d";
|
||||
};
|
||||
};
|
||||
|
||||
boot.loader.systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 10;
|
||||
edk2-uefi-shell.enable = true;
|
||||
};
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.grub.enable = false;
|
||||
|
||||
i18n = rec {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
extraLocales = [ "sv_SE.UTF-8/UTF-8" ];
|
||||
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = defaultLocale;
|
||||
LC_CTYPE = defaultLocale;
|
||||
LC_COLLATE = defaultLocale;
|
||||
LC_IDENTIFICATION = defaultLocale;
|
||||
LC_MEASUREMENT = defaultLocale;
|
||||
LC_MESSAGES = defaultLocale;
|
||||
LC_MONETARY = defaultLocale;
|
||||
LC_NAME = defaultLocale;
|
||||
LC_NUMERIC = defaultLocale;
|
||||
LC_PAPER = defaultLocale;
|
||||
LC_TELEPHONE = defaultLocale;
|
||||
LC_TIME = defaultLocale;
|
||||
};
|
||||
};
|
||||
|
||||
services.xserver.xkb.layout = "se";
|
||||
time.timeZone = "Europe/Stockholm";
|
||||
|
||||
console = {
|
||||
earlySetup = true;
|
||||
font = "ter-v16n";
|
||||
keyMap = "sv-latin1";
|
||||
packages = [ pkgs.terminus_font ];
|
||||
};
|
||||
|
||||
networking.useNetworkd = true;
|
||||
systemd.network.enable = true;
|
||||
systemd.network.wait-online.enable = false;
|
||||
services.resolved.enable = true;
|
||||
services.openssh.enable = true;
|
||||
|
||||
systemd.network.networks."10-wired" = {
|
||||
matchConfig.Name = [
|
||||
"en*"
|
||||
"eth*"
|
||||
];
|
||||
networkConfig = {
|
||||
DHCP = "yes";
|
||||
IPv6AcceptRA = true;
|
||||
};
|
||||
dhcpV4Config.RouteMetric = 100;
|
||||
dhcpV6Config.RouteMetric = 100;
|
||||
};
|
||||
|
||||
programs.zsh.enable = true;
|
||||
programs.htop.enable = true;
|
||||
programs.tmux.enable = true;
|
||||
programs.git.enable = true;
|
||||
programs.lazygit.enable = true;
|
||||
programs.bat.enable = true;
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
|
||||
environment.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
inputs."lolcat++".packages.${pkgs.stdenv.hostPlatform.system}.default
|
||||
|
||||
file
|
||||
cowsay
|
||||
fortune
|
||||
bat
|
||||
fastfetch
|
||||
curl
|
||||
eza
|
||||
fzf
|
||||
git
|
||||
git-lfs
|
||||
ripgrep
|
||||
neovim
|
||||
odt2txt
|
||||
openssl
|
||||
stow
|
||||
tpm2-tools
|
||||
unzip
|
||||
wget
|
||||
killall
|
||||
tealdeer
|
||||
yazi
|
||||
fd
|
||||
|
||||
efibootmgr
|
||||
|
||||
nil
|
||||
|
||||
gcc
|
||||
clang
|
||||
gnumake
|
||||
cmake
|
||||
ninja
|
||||
pkg-config
|
||||
binutils
|
||||
gdb
|
||||
nodejs
|
||||
rustup
|
||||
];
|
||||
|
||||
security.sudo.wheelNeedsPassword = true;
|
||||
|
||||
users.users.${userName}.openssh.authorizedKeys.keys = [ ];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.binBashWrapper;
|
||||
bashWrapper = pkgs.writeShellScriptBin "bash" ''
|
||||
exec /usr/bin/env bash "$@"
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.my.binBashWrapper.enable = lib.mkEnableOption "create a /bin/bash wrapper";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /bin/bash - - - - ${bashWrapper}/bin/bash"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
base = import ./base.nix;
|
||||
binBashWrapper = import ./bin-bash-wrapper.nix;
|
||||
desktopHyprland = import ./desktop-hyprland.nix;
|
||||
mailServer = import ./mail-server;
|
||||
zfsRoot = import ./zfs-root.nix;
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.dconf.enable = true;
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
programs.thunar.enable = true;
|
||||
programs.thunderbird.enable = true;
|
||||
programs.xwayland.enable = true;
|
||||
|
||||
hardware.graphics.enable = true;
|
||||
|
||||
security.polkit.enable = true;
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.displayManager.defaultSession = "hyprland";
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
};
|
||||
|
||||
security.pam.services.login.enableGnomeKeyring = true;
|
||||
security.pam.services.sddm.enableGnomeKeyring = true;
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
services.gvfs.enable = true;
|
||||
services.libinput.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
wireplumber.enable = true;
|
||||
};
|
||||
services.tumbler.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
pkgs.xdg-desktop-portal-hyprland
|
||||
];
|
||||
};
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
jetbrains-mono
|
||||
nerd-fonts.jetbrains-mono
|
||||
nerd-fonts.symbols-only
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-color-emoji
|
||||
vista-fonts
|
||||
corefonts
|
||||
source-han-sans
|
||||
];
|
||||
|
||||
fonts.fontconfig.defaultFonts = {
|
||||
monospace = [
|
||||
"JetBrainsMono Nerd Font"
|
||||
"JetBrains Mono"
|
||||
];
|
||||
sansSerif = [ "Noto Sans" ];
|
||||
serif = [ "Noto Serif" ];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
brightnessctl
|
||||
catfish
|
||||
cliphist
|
||||
dunst
|
||||
ffmpegthumbnailer
|
||||
firefox
|
||||
flatpak
|
||||
ghostty
|
||||
gcr
|
||||
glib
|
||||
grim
|
||||
hypridle
|
||||
hyprlock
|
||||
hyprpaper
|
||||
jq
|
||||
kdePackages.breeze
|
||||
libgsf
|
||||
libnotify
|
||||
libsecret
|
||||
libsForQt5.qt5ct
|
||||
libsForQt5.qtstyleplugin-kvantum
|
||||
mpv
|
||||
networkmanagerapplet
|
||||
pavucontrol
|
||||
papirus-icon-theme
|
||||
playerctl
|
||||
python3
|
||||
qt6Packages.qt6ct
|
||||
qt6Packages.qtstyleplugin-kvantum
|
||||
rofi
|
||||
slurp
|
||||
socat
|
||||
waybar
|
||||
wezterm
|
||||
wl-clipboard
|
||||
ristretto
|
||||
thunar-archive-plugin
|
||||
thunar-volman
|
||||
zathura
|
||||
];
|
||||
|
||||
systemd.user.services.hyprpolkitagent = {
|
||||
description = "Hyprland polkit agent";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.hyprpolkitagent}/bin/hyprpolkitagent";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./mail.nix
|
||||
./roundcube.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
security.acme.acceptTerms = true;
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
services.nginx.virtualHosts.${config.mailserver.fqdn}.enableACME = true;
|
||||
|
||||
mailserver = {
|
||||
enable = true;
|
||||
stateVersion = 4;
|
||||
fqdn = "mail.billenius.com";
|
||||
domains = [ "billenius.com" ];
|
||||
|
||||
x509.useACMEHost = config.mailserver.fqdn;
|
||||
|
||||
# A list of all login accounts. To create the password hashes, use
|
||||
# nix-shell -p mkpasswd --run 'mkpasswd -s'
|
||||
accounts = {
|
||||
"love@billenius.com" = {
|
||||
hashedPasswordFile = ../../../resources/mail-server/love@billenius.com;
|
||||
aliases = [ "postmaster@billenius.com" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
hostName = "mail.billenius.com";
|
||||
package = pkgs.roundcube.withPlugins (
|
||||
plugins: with plugins; [
|
||||
persistent_login
|
||||
]
|
||||
);
|
||||
plugins = [
|
||||
"persistent_login"
|
||||
"managesieve" # built-in
|
||||
];
|
||||
dicts = with pkgs.aspellDicts; [
|
||||
# https://search.nixos.org/packages?query=aspellDicts
|
||||
en
|
||||
sv
|
||||
];
|
||||
maxAttachmentSize = config.mailserver.messageSizeLimit / 1024 / 1024;
|
||||
extraConfig = ''
|
||||
$config['imap_host'] = "ssl://${config.mailserver.fqdn}";
|
||||
$config['smtp_host'] = "ssl://${config.mailserver.fqdn}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
|
||||
$config['managesieve_host'] = "tls://${config.mailserver.fqdn}";
|
||||
$config['managesieve_port'] = 4190;
|
||||
$config['managesieve_usetls'] = true;
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${config.services.roundcube.hostName} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{ ... }:
|
||||
{
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
boot.zfs.devNodes = "/dev/disk/by-id";
|
||||
boot.initrd.systemd.enable = true;
|
||||
boot.initrd.luks.devices.cryptroot = {
|
||||
device = "/dev/disk/by-partlabel/cryptroot";
|
||||
allowDiscards = true;
|
||||
crypttabExtraOpts = [
|
||||
"tpm2-device=auto"
|
||||
"tpm2-pcrs=7"
|
||||
];
|
||||
};
|
||||
|
||||
security.tpm2 = {
|
||||
enable = true;
|
||||
pkcs11.enable = true;
|
||||
tctiEnvironment.enable = true;
|
||||
};
|
||||
|
||||
services.zfs = {
|
||||
autoScrub.enable = true;
|
||||
trim.enable = true;
|
||||
autoSnapshot.enable = true;
|
||||
};
|
||||
|
||||
services.fstrim.enable = false;
|
||||
}
|
||||
Reference in New Issue
Block a user