nixos: add default

This commit is contained in:
genofire 2021-10-08 05:48:27 +02:00
parent 08ff05849b
commit 8786c2387a
3 changed files with 130 additions and 0 deletions

87
nixos/configuration.nix Normal file
View File

@ -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 = "";
}

25
nixos/desktop.nix Normal file
View File

@ -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;
}

18
nixos/genofire.nix Normal file
View File

@ -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;
};
}