Updates
This commit is contained in:
parent
7c8f52e553
commit
74cbd62e3f
4 changed files with 89 additions and 6 deletions
|
@ -142,7 +142,11 @@
|
||||||
|
|
||||||
# NixOS Related
|
# NixOS Related
|
||||||
nix-clean-all() {
|
nix-clean-all() {
|
||||||
sudo nix-env -u --always
|
echo "Optimizing the nix store..."
|
||||||
|
sudo nix-store --optimize
|
||||||
|
echo "nix-store: Collecting Garbage..."
|
||||||
|
sudo nix-store --gc
|
||||||
|
echo "Collecting garbage..."
|
||||||
sudo nix-collect-garbage -d
|
sudo nix-collect-garbage -d
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
@ -187,7 +191,6 @@
|
||||||
dday = "date +%A";
|
dday = "date +%A";
|
||||||
|
|
||||||
# nixos-rebuild
|
# nixos-rebuild
|
||||||
ns = "nix shell";
|
|
||||||
nr = "sudo nixos-rebuild";
|
nr = "sudo nixos-rebuild";
|
||||||
nrs = "sudo nixos-rebuild --upgrade switch";
|
nrs = "sudo nixos-rebuild --upgrade switch";
|
||||||
nrt = "sudo nixos-rebuild test";
|
nrt = "sudo nixos-rebuild test";
|
||||||
|
@ -202,4 +205,4 @@
|
||||||
rebuild-all-remote = "rebuild-host-remote && rebuild-home-remote";
|
rebuild-all-remote = "rebuild-host-remote && rebuild-home-remote";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,8 @@
|
||||||
(nmap "<leader>nc" ":NvimTreeClose<CR>" // desc "[C]lose NvimTree")
|
(nmap "<leader>nc" ":NvimTreeClose<CR>" // desc "[C]lose NvimTree")
|
||||||
(nmap "<leader>nr" ":NvimTreeRefresh<CR>" // desc "[R]efresh NvimTree")
|
(nmap "<leader>nr" ":NvimTreeRefresh<CR>" // desc "[R]efresh NvimTree")
|
||||||
# ToggleTerm
|
# ToggleTerm
|
||||||
(nmap "<leader>TT" ":ToggleTerm<CR>" // desc "[T]oggle Terminal")
|
(nmap "<leader>Tt" ":ToggleTerm<CR>" // desc "[T]oggle Terminal")
|
||||||
|
(nmap "<leader>Ts" ":TermSelect<CR>" // desc "[S]elect a terminal")
|
||||||
# Fugitive
|
# Fugitive
|
||||||
(nmap "<leader>gc" ":Git commit -a<CR>" // desc "[C]ommit" )
|
(nmap "<leader>gc" ":Git commit -a<CR>" // desc "[C]ommit" )
|
||||||
(nmap "<leader>gp" ":Git push<CR>" // desc "Git [p]ush")
|
(nmap "<leader>gp" ":Git push<CR>" // desc "Git [p]ush")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
./disks.nix
|
./disks-gpt.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
../../common/services/tailscale-autoconnect.nix
|
../../common/services/tailscale-autoconnect.nix
|
||||||
../../common/modules/secureboot.nix
|
../../common/modules/secureboot.nix
|
||||||
|
@ -76,4 +76,4 @@
|
||||||
|
|
||||||
distrobox
|
distrobox
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
79
nixos/hosts/nixos-framework/disks-gpt.nix
Normal file
79
nixos/hosts/nixos-framework/disks-gpt.nix
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
{
|
||||||
|
imports = [ ../../common/services/snapper.nix ];
|
||||||
|
|
||||||
|
services.btrfs.autoScrub.enable = true;
|
||||||
|
services.btrfs.autoScrub.interval = "weekly";
|
||||||
|
|
||||||
|
boot.resumeDevice = "/dev/mapper/ROOT";
|
||||||
|
boot.kernelParams = [ "resume_offset=533760" ];
|
||||||
|
# https://sawyershepherd.org/post/hibernating-to-an-encrypted-swapfile-on-btrfs-with-nixos/
|
||||||
|
|
||||||
|
disko.devices.disk.nvme0 = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/nvme0n1";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
BOOT = {
|
||||||
|
priority = 1;
|
||||||
|
name = "BOOT";
|
||||||
|
start = "0%";
|
||||||
|
end = "550MiB";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
# https://github.com/nix-community/disko/issues/527
|
||||||
|
mountOptions = [ "umask=0077" ];
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
}; # partition 1 (ESP)
|
||||||
|
LUKS-ROOT = {
|
||||||
|
start = "550MiB";
|
||||||
|
end = "-64GiB";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "ROOT";
|
||||||
|
extraOpenArgs = [ "--allow-discards" ];
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = [ "-f" ];
|
||||||
|
subvolumes = {
|
||||||
|
"/root" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
}; # root
|
||||||
|
"/home" = {
|
||||||
|
mountpoint = "/home";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
}; # home
|
||||||
|
"/nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
}; # nix
|
||||||
|
# SNAPSHOT SUBVOLS
|
||||||
|
"/root/.snapshots" = {
|
||||||
|
mountpoint = "/.snapshots";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
}; # root
|
||||||
|
"/home/.snapshots" = {
|
||||||
|
mountpoint = "/home/.snapshots";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
}; # home
|
||||||
|
"/nix/.snapshots" = {
|
||||||
|
mountpoint = "/nix/.snapshots";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
}; # nix
|
||||||
|
# Swap partition
|
||||||
|
"/swap" = {
|
||||||
|
mountpoint = "/swap";
|
||||||
|
swap.swapfile.size = "64G";
|
||||||
|
}; # swap
|
||||||
|
}; # subvolumes
|
||||||
|
}; # content.content
|
||||||
|
}; # content
|
||||||
|
}; # partition 2 (/ BTRFS)
|
||||||
|
}; # partitions
|
||||||
|
}; # content
|
||||||
|
}; # disko.devices.disk.nvme0
|
||||||
|
} # nix
|
Loading…
Reference in a new issue