astora: ext4 -> btrfs

This commit is contained in:
L-Nafaryus 2024-04-24 14:26:24 +05:00
parent c8e645a7f4
commit 5217f6d222
Signed by: L-Nafaryus
GPG Key ID: 582F8B0866B294A1
8 changed files with 158 additions and 35 deletions

View File

@ -1,8 +1,11 @@
{ crane-lib, pkgs, ... }:
crane-lib.devShell {
packages = with pkgs; [
# nil
nil
jq
cachix
nodejs
python3
marksman
];
}

View File

@ -0,0 +1,72 @@
# astora
## Specs
| Type | Description |
|---|---|
| Case | MSI MPG Sekira 100R |
| Motherboard | MSI MEG X570 Unify |
| CPU | AMD Ryzen 9 3900X, 12-core, 24-thread |
| Cooler | MSI MAG Coreliquid 240R V2 |
| RAM | Kingston Fury Renegade, 2x16GB |
| Power supply | DeepCool PQ1000M, 1000W |
| GPU | MSI GeForce RTX 3060 Ventus 2X, 12GB |
| NVMe M.2 | Samsung 980, 250GB |
| SSD | Samsung 860 EVO, 500GB |
| HDD | Seagate SkyHawk, 8TB |
## Disk management
* Samsung 980
```bash
parted /dev/nvme0n1 -- mktable gpt
parted /dev/nvme0n1 -- mkpart primary fat32 0% 4GB
parted /dev/nvme0n1 -- set 1 boot on
parted /dev/nvme0n1 -- set 1 no_automount on
parted /dev/nvme0n1 -- mkpart primary btrfs 4GB 100%
mkfs.fat -F 32 /dev/nvme0n1p1
fatlabel /dev/nvme0n1p1 boot
mkfs.btrfs /dev/nvme0n1p2
btrfs filesystem label /dev/nvme0n1p2 nixos
mkdir -p /mnt
mount /dev/nvme0n1p2 /mnt
btrfs subvolume create /mnt/root
btrfs subvolume create /mnt/nix
btrfs subvolume create /mnt/home
btrfs subvolume create /mnt/swap
umount /mnt
mount -o compress=zstd,subvol=root /dev/nvme0n1p2 /mnt
mkdir /mnt/{boot,nix,home,swap}
mount /dev/nvme0n1p1 /mnt/boot
mount -o compress=zstd,noatime,subvol=nix /dev/nvme0n1p2 /mnt/nix
mount -o compress=zstd,subvol=home /dev/nvme0n1p2 /mnt/home
mount -o noatime,subvol=swap /dev/nvme0n1p2 /mnt/swap
btrfs filesystem mkswapfile --size 16g --uuid clear /mnt/swap/swapfile
# umount /mnt
```
* Samsung 860
```bash
parted /dev/sda -- mktable gpt
parted /dev/sda -- mkpart primary btrfs 0% 100%
mkfs.btrfs /dev/sda1
btrfs filesystem label /dev/sda1 nixos
mkdir -p /mnt
mount /dev/sda1 /mnt
btrfs subvolume create /mnt/steam-library
btrfs subvolume create /mnt/lutris
umount /mnt
mount -o compress=zstd,subvol=root /dev/sda1 /media
mkdir /media/{steam-library,lutris}
mount -o compress=zstd,subvol=steam-library /dev/sda1 /media/steam-library
mount -o compress=zstd,subvol=lutris /dev/sda1 /media/lutris
# umount /media
```

View File

@ -8,8 +8,8 @@
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
trusted-users = [ "nafaryus" ];
allowed-users = [ "nafaryus" ];
trusted-users = [ "l-nafaryus" ];
allowed-users = [ "l-nafaryus" ];
substituters = [ "https://nix-community.cachix.org" ];
trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
auto-optimise-store = true;
@ -83,10 +83,17 @@
services.blueman.enable = true;
services.btrfs.autoScrub = {
enable = true;
interval = "monthly";
fileSystems = [ "/" ];
};
# Packages
environment.systemPackages = with pkgs; [
wget
parted
ntfs3g
sshfs
exfat
@ -129,7 +136,7 @@
Host astora
HostName 192.168.156.101
Port 22
User nafaryus
User l-nafaryus
Host catarina
HostName 192.168.156.102

View File

@ -82,27 +82,50 @@
# Filesystem
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/77e1fc4b-31af-46e8-8b9c-907e4113b31b";
fsType = "ext4";
device = "/dev/disk/by-label/nixos";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/92C6-2268";
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
"/mnt/ext" = {
device = "/dev/disk/by-uuid/4b47d83c-42da-4e78-b279-7726dfbdfde7";
fsType = "ext4";
"/nix" = {
device = "/dev/disk/by-label/nixos";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ];
};
"/mnt/ext2" = {
device = "/dev/disk/by-uuid/8f8f6576-5608-4474-acb5-409c59dff696";
fsType = "ext4";
"/home" = {
device = "/dev/disk/by-label/nixos";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ];
};
"/swap" = {
device = "/dev/disk/by-label/nixos";
fsType = "btrfs";
options = [ "subvol=swap" "noatime" ];
};
"/media/steam-library" = {
device = "/dev/disk/by-label/siegward";
fsType = "btrfs";
options = [ "subvol=steam-library" "compress=zstd" ];
};
"/media/lutris" = {
device = "/dev/disk/by-label/siegward";
fsType = "btrfs";
options = [ "subvol=lutris" "compress=zstd" ];
};
};
swapDevices = [ ];
swapDevices = [
{ device = "/swap/swapfile"; }
];
services.fstrim.enable = true;

View File

@ -1,7 +1,7 @@
{ config, pkgs, lib, inputs, self, ... }:
{
# Users
users.users.nafaryus = {
users.users.l-nafaryus = {
isNormalUser = true;
description = "L-Nafaryus";
extraGroups = [ "networkmanager" "wheel" "audio" ];
@ -16,10 +16,10 @@
bonfire.enable = true;
home-manager.users.nafaryus = { pkgs, ... }: {
home-manager.users.l-nafaryus = { pkgs, ... }: {
home.stateVersion = "23.11";
home.username = "nafaryus";
home.homeDirectory = "/home/nafaryus";
home.username = "l-nafaryus";
home.homeDirectory = "/home/l-nafaryus";
home.packages = with pkgs; [
gnupg
git
@ -62,7 +62,7 @@
olive-editor
openshot-qt
musescore
# soundux # unmaintained
# soundux # unmaintained
losslesscut-bin
yt-dlp
ffmpeg
@ -86,8 +86,6 @@
onlyoffice-bin
anydesk
jdk
self.packages.${pkgs.system}.ultimmc
@ -96,15 +94,24 @@
steamtinkerlaunch
];
xdg.enable = true;
xdg.mime.enable = true;
xdg = {
enable = true;
mime.enable = true;
};
home.file.".config/gnupg/gpg-agent.conf".text = ''
default-cache-ttl 3600
pinentry-program ${pkgs.pinentry.gtk2}/bin/pinentry
'';
home.file.".config/git/config".source = "${config.bonfire.configDir}/git/config";
home.file.".config/nvim" = { source = "${config.bonfire.configDir}/nvim"; recursive = true; };
home.file = {
".config/gnupg/gpg-agent.conf".text = ''
default-cache-ttl 3600
pinentry-program ${pkgs.pinentry.gtk2}/bin/pinentry
'';
".config/git/config".source = "${config.bonfire.configDir}/git/config";
".config/nvim" = {
source = "${config.bonfire.configDir}/nvim";
recursive = true;
};
};
};
programs.gnupg.agent = {

View File

@ -1,6 +1,7 @@
# catarina
## Partitions
## Disk management
```sh
mkfs.fat -F 32 /dev/sda1
fatlabel /dev/sda1 boot
@ -25,7 +26,7 @@ mount -o compress=zstd,subvol=home /dev/sda2 /mnt/home
mount -o compress=zstd,subvol=persist /dev/sda2 /mnt/persist
mount -o noatime,subvol=swap /dev/sda2 /mnt/swap
btrfs filesystem mkswapfile --size 16g --uuid clear /swap/swapfile
btrfs filesystem mkswapfile --size 16g --uuid clear /mnt/swap/swapfile
mkdir -p /media/{storage,btrbk-backups,btrbk-snapshots}
```

View File

@ -4,9 +4,19 @@ let cfg = config.bonfire;
in {
options= {
bonfire = {
enable = mkOption { type = types.bool; default = false; };
home = mkOption { type = types.path; default = ../.; };
configDir = mkOption { type = types.path; default = "${config.bonfire.home}/config"; };
enable = mkEnableOption "Enables the Bonfire module";
home = mkOption {
type = types.path;
default = ../.;
description = "Bonfire root flake directory";
};
configDir = mkOption {
type = types.path;
default = "${config.bonfire.home}/config";
description = "Path to directory with static configuration files";
};
};
};

View File

@ -52,7 +52,7 @@ in {
options.services.papermc = {
enable = mkEnableOption "Enables the PaperMC service.";
openFirewall = mkOption rec {
openFirewall = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''