From 8786c2387a921c4b9efe3611bb55ea4cdde5d7c6 Mon Sep 17 00:00:00 2001 From: genofire Date: Fri, 8 Oct 2021 05:48:27 +0200 Subject: [PATCH] nixos: add default --- nixos/configuration.nix | 87 +++++++++++++++++++++++++++++++++++++++++ nixos/desktop.nix | 25 ++++++++++++ nixos/genofire.nix | 18 +++++++++ 3 files changed, 130 insertions(+) create mode 100644 nixos/configuration.nix create mode 100644 nixos/desktop.nix create mode 100644 nixos/genofire.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..52c7c54 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,87 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./desktop.nix + ./genofire.nix + ]; + + # -------- + # always: + # -------- + system.stateVersion = "21.05"; + system.autoUpgrade.enable = true; + + # boot + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + # zfs + boot.initrd.supportedFilesystems = ["zfs"]; # boot from zfs + boot.supportedFilesystems = [ "zfs" ]; + #boot.kernelParams = [ "nohibernate" ]; + boot.zfs.requestEncryptionCredentials = []; # list -> default: true - always request for password + services.zfs.autoScrub.enable = true; + + networking.useNetworkd = true; + networking.useDHCP = false; + services.openssh.enable = true; + + time.timeZone = "Europe/Berlin"; + # i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "de"; + }; + + environment.systemPackages = with pkgs; [ + python3 + killall + htop + mosh + git + git-lfs + tig + figlet + grml-zsh-config + tmux + neovim + xh + liboping + mtr + home-manager + ]; + + + # -------- + # specifical this maschine: + # -------- + + networking.hostId = "6a465f93"; # zfs needed + networking.hostName = "fireEmerald"; # Define your hostname. + # cryptsetup + # boot.initrd.luks.enable = true; + boot.initrd.luks.devices = { + "croot" = { + device = "/dev/disk/by-uuid/e75385e9-b733-49d4-91fd-6ac2fa821195" ; + }; + }; + + # my + users.defaultUserShell = pkgs.zsh; + programs.zsh.enable = true; + programs.zsh.autosuggestions.enable = true; + programs.zsh.syntaxHighlighting.enable = true; + programs.zsh.interactiveShellInit = '' + source ${pkgs.grml-zsh-config}/etc/zsh/zshrc + # Make user colour green in prompt instead of default blue + zstyle ':prompt:grml:left:items:user' pre '%F{green}%B' + ''; + programs.zsh.promptInit = ""; +} + diff --git a/nixos/desktop.nix b/nixos/desktop.nix new file mode 100644 index 0000000..711aea5 --- /dev/null +++ b/nixos/desktop.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: + +{ + networking.wireless.iwd.enable = true; + systemd.network.networks.wifi.matchConfig = { Name = "wlan0";}; + systemd.network.networks.wifi.DHCP = "ipv4"; + + sound.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + #alsa.support32bit = true; + pulse.enable = true; + }; + #services.acpid.enable = true; + + environment.systemPackages = with pkgs; [ + iw + ]; + + # allow wayland / sway + hardware.opengl.enable = true; + # gtk config + programs.dconf.enable = true; +} diff --git a/nixos/genofire.nix b/nixos/genofire.nix new file mode 100644 index 0000000..fc97462 --- /dev/null +++ b/nixos/genofire.nix @@ -0,0 +1,18 @@ +{pkgs, config, ... }: +{ + + services.postgresql = { + enable = true; + package = pkgs.postgresql_14; + dataDir = "/var/lib/postgres/${config.services.postgresql.package.psqlSchema}"; + # dataDir = /var/lib/postgres/data; + }; + + users.users.genofire = { + uid = 1021; + home = "/home/genofire"; + extraGroups = ["wheel"]; + isNormalUser = true; + useDefaultShell = true; + }; +}