nixMain cryptorootm, shared power managment
This commit is contained in:
parent
c5f84b4fa2
commit
f4363c36f6
39
README.md
39
README.md
@ -17,3 +17,42 @@ Deployment:
|
||||
Used as kde config finder, in `~./config` and `~./local/share`:
|
||||
- `find . -type f -regex '.*\(k\|rc\|pulse\|session\|gtk\|autostart\|xbel\).*'`
|
||||
|
||||
### Disc encryption steps
|
||||
```bash
|
||||
# Cryptoroot, fs and mount
|
||||
cryptsetup luksFormat /dev/nvme0n1p2
|
||||
cryptsetup luksOpen /dev/nvme0n1p2 cryptroot
|
||||
mkfs.btrfs -L root /dev/mapper/cryptroot
|
||||
mount /dev/disk/by-label/root /mnt/
|
||||
|
||||
# Mount boot
|
||||
# change type of boot to uefi via fdisk
|
||||
mkdir /mnt/boot
|
||||
mount /dev/nvme0n1p1 /mnt/boot/
|
||||
|
||||
# Cryptoswap and makeswap
|
||||
cryptsetup luksFormat /dev/nvme0n1p3 --label cryptoswap
|
||||
cryptsetup luksOpen /dev/disk/by-label/cryptoswap swap
|
||||
sudo mkswap /dev/mapper/swap -L swap
|
||||
|
||||
# get hw-config
|
||||
nixos-generate-config --root /mnt/
|
||||
cp /mnt/etc/nixos/hardware-configuration.nix /
|
||||
vim /hardware-configuration.nix
|
||||
# Append:
|
||||
# swapDevices = [{
|
||||
# device = "/dev/disk/by-label/swap";
|
||||
# encrypted = {
|
||||
# enable = true;
|
||||
# label = "swap";
|
||||
# blkDev = "/dev/disk/by-label/cryptoswap";
|
||||
# };
|
||||
# }];
|
||||
|
||||
# Deploy config
|
||||
rm -r /mnt/etc/nixos/
|
||||
cp -r dotfiles-master/dotfiles/root-conf/nixos/ /mnt/etc
|
||||
cp /hardware-configuration.nix /mnt/etc/nixos/DESTINATION
|
||||
|
||||
nixos-install --root /mnt --flake /mnt/etc/nixos#DESTINATION
|
||||
```
|
||||
|
||||
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
Host 78.46.239.229 168.119.171.217 78.47.196.196 5.75.139.112 mail.bak-it.de web.bak-it.de forum.linksjugend-solid.de backuppc.bak-it.de login.bak-it.de stuff.bak-it.de
|
||||
Host 78.46.239.229 168.119.171.217 78.47.196.196 5.75.139.112 mail.bak-it.de web.bak-it.de cloud.linksjugend-solid.de forum.linksjugend-solid.de backuppc.bak-it.de login.bak-it.de login.linksjugend-solid.de stuff.bak-it.de
|
||||
User root
|
||||
IdentityFile ~/.ssh/solidProd
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
; Thunar GtkAccelMap rc-file -*- scheme -*-
|
||||
; thunar GtkAccelMap rc-file -*- scheme -*-
|
||||
; this file is an automated accelerator map dump
|
||||
;
|
||||
; (gtk_accel_path "<Actions>/ThunarDetailsView/expandable-folders" "")
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<property name="last-window-maximized" type="bool" value="true"/>
|
||||
<property name="last-details-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_38_PERCENT"/>
|
||||
<property name="last-details-view-visible-columns" type="string" value="THUNAR_COLUMN_DATE_CREATED,THUNAR_COLUMN_DATE_MODIFIED,THUNAR_COLUMN_GROUP,THUNAR_COLUMN_MIME_TYPE,THUNAR_COLUMN_NAME,THUNAR_COLUMN_OWNER,THUNAR_COLUMN_PERMISSIONS,THUNAR_COLUMN_SIZE"/>
|
||||
<property name="last-details-view-column-widths" type="string" value="159,159,159,127,92,599,74,580,514,214,118,81,126,156"/>
|
||||
<property name="last-details-view-column-widths" type="string" value="159,159,159,127,92,599,74,375,247,214,118,81,126,156"/>
|
||||
<property name="last-separator-position" type="int" value="216"/>
|
||||
<property name="last-show-hidden" type="bool" value="true"/>
|
||||
<property name="misc-single-click" type="bool" value="false"/>
|
||||
@ -32,7 +32,7 @@
|
||||
<property name="misc-folder-item-count" type="string" value="THUNAR_FOLDER_ITEM_COUNT_ALWAYS"/>
|
||||
<property name="last-details-view-column-order" type="string" value="THUNAR_COLUMN_NAME,THUNAR_COLUMN_DATE_MODIFIED,THUNAR_COLUMN_SIZE,THUNAR_COLUMN_SIZE_IN_BYTES,THUNAR_COLUMN_TYPE,THUNAR_COLUMN_LOCATION,THUNAR_COLUMN_MIME_TYPE,THUNAR_COLUMN_DATE_CREATED,THUNAR_COLUMN_PERMISSIONS,THUNAR_COLUMN_OWNER,THUNAR_COLUMN_GROUP,THUNAR_COLUMN_DATE_ACCESSED,THUNAR_COLUMN_RECENCY,THUNAR_COLUMN_DATE_DELETED"/>
|
||||
<property name="last-tabs-left" type="array">
|
||||
<value type="string" value="file:///home/someone/.config/yolk/root-conf/nixos/local-pkgs"/>
|
||||
<value type="string" value="file:///mnt/DT01ACA3"/>
|
||||
</property>
|
||||
<property name="last-focused-tab-left" type="int" value="0"/>
|
||||
<property name="last-focused-tab-right" type="int" value="0"/>
|
||||
|
||||
@ -190,7 +190,7 @@
|
||||
"debugger": {
|
||||
"dock": "bottom",
|
||||
},
|
||||
"disable_ai": false,
|
||||
"disable_ai": true,
|
||||
"terminal": {
|
||||
"toolbar": {
|
||||
"breadcrumbs": false,
|
||||
|
||||
@ -24,26 +24,6 @@ in
|
||||
|
||||
networking.hostName = "nixLap";
|
||||
|
||||
powerManagement.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
# Suspend first then hibernate when closing the lid
|
||||
services.logind.settings.Login.lidSwitch = "suspend-then-hibernate";
|
||||
# Hibernate on power button pressed
|
||||
services.logind.settings.Login.powerKey = "hibernate";
|
||||
services.logind.settings.Login.powerKeyLongPress = "poweroff";
|
||||
|
||||
# Hibernation
|
||||
boot.resumeDevice = "/dev/disk/by-label/swap";
|
||||
# resume offset from: filefrag -v /swapfile # under 0. physical offset
|
||||
boot.kernelParams = ["mem_sleep_default=freeze" "resume_offset=0" ];
|
||||
|
||||
|
||||
# Define time delay for hibernation
|
||||
systemd.sleep.settings.Sleep = {
|
||||
HibernateDelaySec = "30m";
|
||||
SuspendState = "mem";
|
||||
};
|
||||
|
||||
# Start the driver at boot
|
||||
systemd.services.fprintd = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
@ -144,6 +124,7 @@ in
|
||||
users.groups.wireshark = {};
|
||||
users.users.someone = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
description = "someone";
|
||||
extraGroups = [ "networkmanager" "wheel" "libvirtd" "wireshark"];
|
||||
packages = with pkgs; [];
|
||||
|
||||
@ -1,7 +1,3 @@
|
||||
|
||||
# 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, pkgs-unstable, ... }:
|
||||
let
|
||||
optionalPkgs = import ../optional-packages.nix { inherit pkgs; };
|
||||
@ -18,9 +14,6 @@ in
|
||||
|
||||
services.flatpak.enable = true;
|
||||
|
||||
|
||||
# Hybrantion
|
||||
boot.resumeDevice = "/dev/disk/by-uuid/1942318f-792a-4c0c-9b42-6e146d835bd7";
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
@ -44,15 +37,6 @@ in
|
||||
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", GROUP="gpio", MODE="0660"
|
||||
'';
|
||||
|
||||
services.logind.settings.Login.powerKey = "ignore";
|
||||
services.logind.settings.Login.powerKeyLongPress = "ignore";
|
||||
services.logind.settings.Login.rebootKey = "ignore";
|
||||
|
||||
systemd.sleep.settings.Sleep = {
|
||||
SuspendState = "freeze";
|
||||
};
|
||||
|
||||
|
||||
# Enable openrgb
|
||||
services.hardware.openrgb.enable = true;
|
||||
|
||||
@ -100,6 +84,7 @@ in
|
||||
users.groups.gpio = {};
|
||||
users.groups.wireshark = {};
|
||||
users.users.someone = {
|
||||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
description = "someone";
|
||||
extraGroups = [ "wheel" "docker" "libvirtd" "gpio" "wireshark" "adbusers" ];
|
||||
@ -115,13 +100,20 @@ in
|
||||
shell = pkgs.bash;
|
||||
};
|
||||
|
||||
# Use lemurs as display manager
|
||||
services.displayManager.ly = {
|
||||
# Use ly as display manager
|
||||
services.displayManager = {
|
||||
ly = {
|
||||
enable = true;
|
||||
settings = {
|
||||
tty = 1;
|
||||
};
|
||||
};
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "someone";
|
||||
};
|
||||
defaultSession = "hyprland";
|
||||
};
|
||||
|
||||
# Docker
|
||||
virtualisation.docker.enable = true;
|
||||
@ -168,6 +160,7 @@ in
|
||||
bind # dig, nslookup
|
||||
|
||||
# Hyprland stuff
|
||||
uwsm # might not be needet, test login without
|
||||
kitty
|
||||
dunst
|
||||
waybar
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# 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, nixpkgs, modulesPath, ... }:
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
@ -14,28 +14,26 @@
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/4b53ce3e-72b3-4ea4-8656-e90b48da3b65";
|
||||
{ device = "/dev/mapper/cryptroot";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@" ];
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/52e65cdf-08a0-45af-87f2-d83d6a5c2321";
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/9810-0A10";
|
||||
{ device = "/dev/disk/by-uuid/08D8-2E5B";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/1942318f-792a-4c0c-9b42-6e146d835bd7"; }
|
||||
];
|
||||
|
||||
# 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.enp6s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
|
||||
swapDevices = [{
|
||||
device = "/dev/disk/by-label/swap";
|
||||
encrypted = {
|
||||
enable = true;
|
||||
label = "swap";
|
||||
blkDev = "/dev/disk/by-label/cryptoswap";
|
||||
};
|
||||
}];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
@ -36,6 +36,26 @@
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
powerManagement.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
# Suspend first then hibernate when closing the lid
|
||||
services.logind.settings.Login.lidSwitch = "suspend-then-hibernate";
|
||||
# Hibernate on power button pressed
|
||||
services.logind.settings.Login.powerKey = "hibernate";
|
||||
services.logind.settings.Login.powerKeyLongPress = "poweroff";
|
||||
|
||||
# Hibernation
|
||||
boot.resumeDevice = "/dev/disk/by-label/swap";
|
||||
# resume offset from: filefrag -v /swapfile # under 0. physical offset
|
||||
boot.kernelParams = ["mem_sleep_default=freeze" "resume_offset=0" ];
|
||||
|
||||
|
||||
# Define time delay for hibernation
|
||||
systemd.sleep.settings.Sleep = {
|
||||
HibernateDelaySec = "30m";
|
||||
SuspendState = "mem";
|
||||
};
|
||||
|
||||
programs.wireshark = {
|
||||
enable = true;
|
||||
usbmon.enable = true; # Allow USB monitoring
|
||||
|
||||
@ -95,8 +95,6 @@ if [[ $UPGRADE -eq 1 ]]; then
|
||||
fi
|
||||
ARGS+="--flake /etc/nixos"
|
||||
|
||||
echo $ARGS
|
||||
|
||||
echo "Running: nixos-rebuild $ARGS"
|
||||
nixos-rebuild $ARGS
|
||||
cp /etc/nixos/flake.lock root-conf/nixos/flake.lock
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user