From 843d541ab570a4df85dea9870f8c4adfb46d6b3e Mon Sep 17 00:00:00 2001 From: Dmitriy Holkin Date: Sun, 22 Mar 2020 01:07:54 +0400 Subject: [PATCH] update --- hardware-configuration/Dell-Laptop.nix | 25 +++--------------------- install/install.sh | 25 +++++------------------- modules/applications/packages.nix | 3 ++- modules/devices.nix | 24 ++++------------------- modules/filesystems.nix | 27 +------------------------- modules/services.nix | 16 +++++++-------- 6 files changed, 23 insertions(+), 97 deletions(-) mode change 100644 => 100755 hardware-configuration/Dell-Laptop.nix mode change 100644 => 100755 install/install.sh mode change 100644 => 100755 modules/applications/packages.nix mode change 100644 => 100755 modules/devices.nix mode change 100644 => 100755 modules/filesystems.nix mode change 100644 => 100755 modules/services.nix diff --git a/hardware-configuration/Dell-Laptop.nix b/hardware-configuration/Dell-Laptop.nix old mode 100644 new mode 100755 index 40567a5..0af4032 --- a/hardware-configuration/Dell-Laptop.nix +++ b/hardware-configuration/Dell-Laptop.nix @@ -14,30 +14,11 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/8b1fe87c-42d3-40b1-bceb-fc9e2dc83fb6"; - fsType = "btrfs"; - options = [ "subvol=@nixos" ]; + { device = "/dev/disk/by-uuid/68bcbb81-34dd-4661-82ba-1ff2ef048e2d"; + fsType = "f2fs"; }; - boot.initrd.luks.devices."cryptnixos".device = "/dev/disk/by-uuid/51c780b4-cbdd-4ccb-9cc9-a8b2f17e9e64"; - - fileSystems."/.snapshots" = - { device = "/dev/disk/by-uuid/8b1fe87c-42d3-40b1-bceb-fc9e2dc83fb6"; - fsType = "btrfs"; - options = [ "subvol=@snapshots" ]; - }; - - fileSystems."/home" = - { device = "/dev/disk/by-uuid/8b1fe87c-42d3-40b1-bceb-fc9e2dc83fb6"; - fsType = "btrfs"; - options = [ "subvol=@home" ]; - }; - - fileSystems."/nix/store" = - { device = "/dev/disk/by-uuid/8b1fe87c-42d3-40b1-bceb-fc9e2dc83fb6"; - fsType = "btrfs"; - options = [ "subvol=@nix-store" ]; - }; + boot.initrd.luks.devices."cryptnixos".device = "/dev/disk/by-uuid/d287bbf7-ba7e-4316-8c68-072bb21dc8b1"; fileSystems."/boot" = { device = "/dev/disk/by-uuid/7294-A273"; diff --git a/install/install.sh b/install/install.sh old mode 100644 new mode 100755 index 7447d4f..4c0f2a2 --- a/install/install.sh +++ b/install/install.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash cd .. CONFIG_FOLDER=$(pwd) -niv update nixpkgs cd install ENCRYPT_ROOT=true @@ -26,27 +25,13 @@ if [[ "$ENCRYPT_ROOT" == true ]]; then cryptsetup --type luks2 --cipher aes-xts-plain64 --key-size 256 --hash sha512 luksFormat $ROOT_PARTITION cryptsetup luksOpen --type luks2 $ROOT_PARTITION $ROOT_NAME ROOT_NAME=/dev/mapper/$ROOT_NAME - mkfs.btrfs -f -L root $ROOT_NAME - mount -t btrfs -o compress=zstd,noatime,ssd $ROOT_NAME /mnt + mkfs.f2fs -f -l root $ROOT_NAME + mount $ROOT_NAME /mnt else ROOT_NAME=$ROOT_PARTITION - mkfs.btrfs -f -L root $ROOT_PARTITION - mount -t btrfs -o compress=zstd,noatime,ssd $ROOT_PARTITION /mnt + mkfs.f2fs -f -l root $ROOT_PARTITION + mount $ROOT_PARTITION /mnt fi -btrfs subvolume create /mnt/@nixos -btrfs subvolume create /mnt/@nix-store -btrfs subvolume create /mnt/@home -btrfs subvolume create /mnt/@snapshots -umount /mnt -mount -t btrfs -o subvol=@nixos,compress=zstd,noatime,ssd $ROOT_NAME /mnt/ -mkdir -p /mnt/.snapshots -mkdir -p /mnt/home -mkdir -p /mnt/nix/store -mount -t btrfs -o subvol=@snapshots,compress=zstd,noatime,ssd $ROOT_NAME /mnt/.snapshots -mount -t btrfs -o subvol=@home,compress=zstd,noatime,ssd $ROOT_NAME /mnt/home -mount -t btrfs -o subvol=@nix-store,compress=zstd,noatime,ssd $ROOT_NAME /mnt/nix/store -btrfs subvolume create /mnt/tmp -btrfs subvolume create /mnt/var # Mount boot mkdir /mnt/boot mount $BOOT_PARTITION /mnt/boot @@ -58,7 +43,7 @@ cp /mnt/etc/nixos/hardware-configuration.nix $CONFIG_FOLDER/hardware-configurati echo "import $CONFIG_FOLDER \"$DEVICE_NAME\"" > /mnt/etc/nixos/configuration.nix sed -i 's#nixos-config=/etc/nixos/#nixos-config=/mnt/etc/nixos/#' $CONFIG_FOLDER/modules/packages.nix read -p "Please, add swap device into nixos-config/modules/filesystems.nix before continue" -nixos-install -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz --max-jobs $MAX_JOBS --no-root-passwd +nixos-install -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/d96bd3394b734487d1c3bfbac0e8f17465e03afe.tar.gz --max-jobs $MAX_JOBS --no-root-passwd read -p "Press enter to continue" sed -i 's#nixos-config=/mnt/etc/nixos/#nixos-config=/etc/nixos/#' $CONFIG_FOLDER/modules/packages.nix mkdir -p /mnt/home/alukard/nixos-config diff --git a/modules/applications/packages.nix b/modules/applications/packages.nix old mode 100644 new mode 100755 index 498567e..6ac2c75 --- a/modules/applications/packages.nix +++ b/modules/applications/packages.nix @@ -101,8 +101,9 @@ in { steam steam-run protontricks + lutris # retroarch - ] ++ lib.optionals (enableDocker) [ + ] ++ lib.optionals (enableVirtualisation) [ docker-compose ]; diff --git a/modules/devices.nix b/modules/devices.nix old mode 100644 new mode 100755 index 41524c6..7f15dd0 --- a/modules/devices.nix +++ b/modules/devices.nix @@ -19,7 +19,7 @@ with types; { cpu = devInfo.cpu.vendor; video = devInfo.video; isSSD = devInfo.drive.type == "ssd"; - enableDocker = devInfo.enableDocker; + enableVirtualisation = devInfo.enableVirtualisation; hostName = if !isNull devInfo.hostName then devInfo.hostName else @@ -40,25 +40,9 @@ with types; { video = "amd"; ram = 16; isShared = false; - enableDocker = true; + enableVirtualisation = true; hostName = "ataraxia-pc"; }; - PackardBell-Laptop = { - cpu = { - vendor = "intel"; - clock = 2500; - cores = 2; - }; - drive = { - type = "hdd"; - size = 500; - }; - video = "nvidia"; - ram = 6; - isShared = true; - enableDocker = false; - hostName = null; - }; Dell-Laptop = { cpu = { vendor = "intel"; @@ -72,7 +56,7 @@ with types; { video = "intel"; ram = 8; isShared = false; - enableDocker = true; + enableVirtualisation = true; hostName = "dell-ataraxia"; }; NixOS-VM = { @@ -88,7 +72,7 @@ with types; { video = "virtualbox"; ram = 4; isShared = false; - enableDocker = false; + enableVirtualisation = false; hostName = null; }; }; diff --git a/modules/filesystems.nix b/modules/filesystems.nix old mode 100644 new mode 100755 index 34e29e8..0057797 --- a/modules/filesystems.nix +++ b/modules/filesystems.nix @@ -4,31 +4,6 @@ with rec { }; with deviceSpecific; { fileSystems = { - "/" = { - options = if isSSD then - [ "ssd" "noatime" "compress=zstd" ] - else - [ "noatime" "compress=zstd" ]; - }; - "/.snapshots" = { - options = if isSSD then - [ "ssd" "noatime" "compress=zstd" ] - else - [ "noatime" "compress=zstd" ]; - }; - "/home" = { - options = if isSSD then - [ "ssd" "noatime" "compress=zstd" ] - else - [ "noatime" "compress=zstd" ]; - }; - "/nix/store" = { - options = if isSSD then - [ "ssd" "noatime" "compress=zstd" ] - else - [ "noatime" "compress=zstd" ]; - }; - "/shared/nixos" = lib.mkIf isVM { fsType = "vboxsf"; device = "shared"; @@ -128,4 +103,4 @@ with deviceSpecific; { randomEncryption.enable = true; } ]; -} \ No newline at end of file +} diff --git a/modules/services.nix b/modules/services.nix old mode 100644 new mode 100755 index d050891..39368d8 --- a/modules/services.nix +++ b/modules/services.nix @@ -5,10 +5,10 @@ in { services.acpid.enable = true; - services.btrfs.autoScrub = { - enable = true; - interval = "weekly"; - }; + # services.btrfs.autoScrub = { + # enable = true; + # interval = "weekly"; + # }; services.redshift = { enable = true; @@ -48,12 +48,12 @@ in { services.gnome3.gnome-keyring.enable = true; - virtualisation.docker.enable = device.enableDocker; + virtualisation.docker.enable = device.enableVirtualisation; - # virtualisation.virtualbox.host = lib.mkIf config.deviceSpecific.isHost { - # enable = true; + # virtualisation.virtualbox.host = { + # enable = device.enableVirtualisation; # # enableHardening = false; - # enableExtensionPack = true; + # enableExtensionPack = false; # }; # Install cdemu for some gaming purposes