mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Fix murk
This commit is contained in:
parent
97fddca4a4
commit
f7fe0becd1
5 changed files with 71 additions and 23 deletions
|
|
@ -3,7 +3,10 @@
|
||||||
```sh
|
```sh
|
||||||
git clone https://codeberg.org/muon/home && cd home
|
git clone https://codeberg.org/muon/home && cd home
|
||||||
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount hosts/$(hostname)/disk-config.nix
|
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount hosts/$(hostname)/disk-config.nix
|
||||||
sudo btrfs subvolume snapshot -r /mnt /mnt/root-blank
|
sudo mkdir /tmp/mnt
|
||||||
|
sudo mount /dev/mapper/crypted /tmp/mnt
|
||||||
|
sudo btrfs subvolume snapshot -r /tmp/mnt/root /tmp/mnt/root-blank
|
||||||
|
sudo umount /tmp/mnt
|
||||||
sudo nixos-generate-config --root /mnt
|
sudo nixos-generate-config --root /mnt
|
||||||
cp /mnt/etc/nixos/hardware-configuration.nix hosts/$(hostname)/hardware-configuration.nix
|
cp /mnt/etc/nixos/hardware-configuration.nix hosts/$(hostname)/hardware-configuration.nix
|
||||||
sudo nixos-install --root /mnt --no-root-passwd --flake .#$(hostname)
|
sudo nixos-install --root /mnt --no-root-passwd --flake .#$(hostname)
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,9 @@ in {
|
||||||
# Hardware
|
# Hardware
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./disk-config.nix
|
|
||||||
inputs.impermanence.nixosModules.impermanence
|
inputs.impermanence.nixosModules.impermanence
|
||||||
(inputs.nixpkgs
|
# (inputs.nixpkgs
|
||||||
+ "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
|
# + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = with inputs.nix-alien.packages.${system};
|
environment.systemPackages = with inputs.nix-alien.packages.${system};
|
||||||
|
|
@ -22,13 +21,13 @@ in {
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
mods.desktop.enable = true;
|
mods.desktop.enable = true;
|
||||||
mods.boot.enable = false;
|
mods.boot.enable = true;
|
||||||
|
|
||||||
mods.theme.enable = true;
|
mods.theme.enable = true;
|
||||||
mods.theme.scheme = "woodland";
|
mods.theme.scheme = "woodland";
|
||||||
mods.theme.wallpaper = ./wallpaper.png;
|
mods.theme.wallpaper = ./wallpaper.png;
|
||||||
|
|
||||||
mods.impermanence.enable = false;
|
mods.impermanence.enable = true;
|
||||||
|
|
||||||
services.xserver.windowManager.i3.enable = true;
|
services.xserver.windowManager.i3.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
{ inputs }: {
|
{
|
||||||
inputs.disko.devices = {
|
disko.devices = {
|
||||||
disk = {
|
disk = {
|
||||||
main = {
|
main = {
|
||||||
type = "disk";
|
type = "disk";
|
||||||
device = "/dev/disk/by-diskseq/1";
|
device = "/dev/sda";
|
||||||
content = {
|
content = {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,61 @@
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules =
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
||||||
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
boot.supportedFilesystems = [ "zfs" "ntfs" "btrfs" ];
|
|
||||||
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/mapper/crypted";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=root" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/1ca0c5f6-3cb3-4f86-94a5-4376461da227";
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/4BD8-A887";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/home" =
|
||||||
|
{ device = "/dev/mapper/crypted";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=home" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/nix" =
|
||||||
|
{ device = "/dev/mapper/crypted";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=nix" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/persist" =
|
||||||
|
{ device = "/dev/mapper/crypted";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=persist" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/swap" =
|
||||||
|
{ device = "/dev/mapper/crypted";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=swap" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/var/log" =
|
||||||
|
{ device = "/dev/mapper/crypted";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=log" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,17 +9,18 @@ let
|
||||||
# fs-diff.sh
|
# fs-diff.sh
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
OLD_TRANSID=$(sudo btrfs subvolume find-new /mnt/root-blank 9999999)
|
sudo mkdir /btrfs_tmp
|
||||||
OLD_TRANSID=${OLD_TRANSID}
|
sudo mount -o subvol=/ /dev/mapper/crypted /btrfs_tmp
|
||||||
|
|
||||||
sudo mkdir /mnt
|
OLD_TRANSID=$(sudo btrfs subvolume find-new /btrfs_tmp/root-blank 9999999)
|
||||||
sudo mount -o subvol=/ /dev/mapper/crypted /mnt
|
OLD_TRANSID=''${OLD_TRANSID#transid marker was }
|
||||||
sudo btrfs subvolume find-new "/mnt/root" "$OLD_TRANSID" |
|
|
||||||
sed \'$d\' |
|
sudo btrfs subvolume find-new "/btrfs_tmp/root" "$OLD_TRANSID" |
|
||||||
|
sed '$d' |
|
||||||
cut -f17- -d' ' |
|
cut -f17- -d' ' |
|
||||||
sort |
|
sort |
|
||||||
uniq |
|
uniq |
|
||||||
while read path; do
|
while read -r path; do
|
||||||
path="/$path"
|
path="/$path"
|
||||||
if [ -L "$path" ]; then
|
if [ -L "$path" ]; then
|
||||||
: # The path is a symbolic link, so is probably handled by NixOS already
|
: # The path is a symbolic link, so is probably handled by NixOS already
|
||||||
|
|
@ -29,7 +30,7 @@ let
|
||||||
echo "$path"
|
echo "$path"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sudo umount /mnt
|
sudo umount /btrfs_tmp
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in with lib; {
|
in with lib; {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue