Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into specialisations
Browse files Browse the repository at this point in the history
  • Loading branch information
ErrorNoInternet committed May 20, 2024
2 parents dbbcb74 + 1a28608 commit 0e0df38
Show file tree
Hide file tree
Showing 17 changed files with 1,060 additions and 109 deletions.
1 change: 1 addition & 0 deletions home/hosts/rescanix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
tbw
testdisk
timg
tor-browser
unigine-heaven
upx
usbutils
Expand Down
1 change: 1 addition & 0 deletions home/programs/terminal/fish/functions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
end
function glfzf -d "use fzf to preview git commits"
set SHELL fish
git log --graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" $argv | \
fzf --ansi --no-sort --reverse --tiebreak=index --scroll-off=5 --preview-window=right:60% \
--preview 'function preview; set commit (echo $argv | grep -o "[a-f0-9]\{7\}"); git show -m --color=always $commit | delta --width=(tput cols); end; preview {}' \
Expand Down
10 changes: 10 additions & 0 deletions library/derivations/autotools.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rec {
mkFlags = old: flags: {
configureFlags = (old.cmakeFlags or []) ++ flags;
};

optimizeLto = derivation:
derivation.overrideAttrs (old: (mkFlags old [
"--enable-lto"
]));
}
2 changes: 2 additions & 0 deletions library/derivations/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
args: {
architectures = import ./architectures.nix args;

autotools = import ./autotools.nix;

c = import ./c.nix args;

cmake = import ./cmake.nix;
Expand Down
181 changes: 91 additions & 90 deletions nixos/server/hosts/crix/disko.nix
Original file line number Diff line number Diff line change
@@ -1,109 +1,110 @@
{config, ...}: {
disko.devices = {
disk.primary = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
label = "BOOT";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
disko.devices.disk.primary = {
type = "disk";
device = "/dev/vda";

content = {
type = "gpt";

partitions = {
ESP = {
size = "512M";
type = "EF00";
label = "boot";

content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};

root = {
size = "100%";
label = "root";
root = {
size = "100%";
label = "root";

content = {
type = "zfs";
pool = config.host.name;
};
content = {
type = "zfs";
pool = config.host.name;
};
};
};
};
};

zpool.${config.host.name} = {
type = "zpool";
disko.devices.zpool.${config.host.name} = {
type = "zpool";

options = {
ashift = "12";
compatibility = "openzfs-2.2-linux";
};
options = {
ashift = "12";
compatibility = "openzfs-2.2-linux";
};

rootFsOptions = {
"com.sun:auto-snapshot" = "true";
acltype = "posix";
compression = "zstd";
dnodesize = "auto";
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "prompt";
mountpoint = "none";
normalization = "formD";
xattr = "sa";
};
rootFsOptions = {
"com.sun:auto-snapshot" = "true";
acltype = "posix";
compression = "zstd";
dnodesize = "auto";
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "prompt";
mountpoint = "none";
normalization = "formD";
xattr = "sa";
};

datasets = {
root = {
mountpoint = "/";
type = "zfs_fs";
options.mountpoint = "legacy";
};
"root/home" = {
mountpoint = "/home";
type = "zfs_fs";
options = {
mountpoint = "legacy";
refreservation = "1G";
};
};
"root/var" = {
mountpoint = "/var";
type = "zfs_fs";
options.mountpoint = "legacy";
datasets = {
root = {
mountpoint = "/";
type = "zfs_fs";
options.mountpoint = "legacy";
};
"root/home" = {
mountpoint = "/home";
type = "zfs_fs";
options = {
mountpoint = "legacy";
refreservation = "1G";
};
"root/var/coredump" = {
mountpoint = "/var/lib/systemd/coredump";
type = "zfs_fs";
options = {
atime = "off";
compression = "zle";
mountpoint = "legacy";
recordsize = "1M";
};
};
"root/var" = {
mountpoint = "/var";
type = "zfs_fs";
options.mountpoint = "legacy";
};
"root/var/coredump" = {
mountpoint = "/var/lib/systemd/coredump";
type = "zfs_fs";
options = {
atime = "off";
compression = "zle";
mountpoint = "legacy";
recordsize = "1M";
};
"root/var/log" = {
mountpoint = "/var/log";
type = "zfs_fs";
options = {
atime = "off";
mountpoint = "legacy";
};
};
"root/var/log" = {
mountpoint = "/var/log";
type = "zfs_fs";
options = {
atime = "off";
mountpoint = "legacy";
};
"root/nix" = {
mountpoint = "/nix";
type = "zfs_fs";
options = {
atime = "off";
mountpoint = "legacy";
};
};
"root/nix" = {
mountpoint = "/nix";
type = "zfs_fs";
options = {
atime = "off";
mountpoint = "legacy";
};
"root/nix/store" = {
mountpoint = "/nix/store";
type = "zfs_fs";
options = {
"com.sun:auto-snapshot" = "false";
mountpoint = "legacy";
recordsize = "256K";
};
};
"root/nix/store" = {
mountpoint = "/nix/store";
type = "zfs_fs";
options = {
"com.sun:auto-snapshot" = "false";
mountpoint = "legacy";
recordsize = "256K";
};
};
};
Expand Down
3 changes: 2 additions & 1 deletion nixos/workstation/hosts/msix/disko.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
ESP = {
size = "1G";
type = "EF00";
label = "BOOT";
label = "boot";

content = {
type = "filesystem";
format = "vfat";
Expand Down
3 changes: 2 additions & 1 deletion nixos/workstation/hosts/rescanix/disko.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
ESP = {
size = "512M";
type = "EF00";
label = "BOOT";
label = "boot";

content = {
type = "filesystem";
format = "vfat";
Expand Down
1 change: 0 additions & 1 deletion nixos/workstation/modules/kernel/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ in {
kernel.sysctl = {
"kernel.sysrq" = mkDefault 1;

"vm.dirty_background_ratio" = 15;
"vm.dirty_ratio" = 25;
};
};
Expand Down
8 changes: 7 additions & 1 deletion packages/btrfs-progs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ btrfs-progs.overrideAttrs (old: {
(old.patches or [])
++ [
./dump-csum.patch
./receive-selinux.patch
./remove-receive-errors.patch
];

configureFlags =
(old.configureFlags or [])
++ [
"--enable-experimental"
];
})
15 changes: 8 additions & 7 deletions packages/btrfs-progs/dump-csum.patch
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ index c19e664a..8d491c8f 100644
DECLARE_COMMAND(send);
diff --git a/cmds/inspect-dump-csum.c b/cmds/inspect-dump-csum.c
new file mode 100644
index 00000000..8e607e51
index 00000000..4597ebf6
--- /dev/null
+++ b/cmds/inspect-dump-csum.c
@@ -0,0 +1,243 @@
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2019 SUSE. All rights reserved.
+ *
Expand Down Expand Up @@ -223,7 +223,7 @@ index 00000000..8e607e51
+}
+
+static const char * const cmd_inspect_dump_csum_usage[] = {
+ "btrfs inspect-internal dump-csum <path> <device>",
+ "btrfs inspect-internal dump-csum <file> <device>",
+ "Dump checksums for a given file",
+ "",
+ OPTLINE("-d|--debug", "Be more verbose"),
Expand Down Expand Up @@ -269,13 +269,13 @@ index 00000000..8e607e51
+
+ fd = open(filename, O_RDONLY);
+ if (fd < 0) {
+ error("cannot open file %s: %m", filename);
+ error("couldn't open file %s: %m", filename);
+ return -errno;
+ }
+
+ devfd = open(device, O_RDONLY);
+ if (devfd < 0) {
+ error("cannot open device %s: %m", device);
+ error("couldn't open device %s: %m", device);
+ ret = -errno;
+ goto out_close;
+ }
Expand All @@ -284,13 +284,14 @@ index 00000000..8e607e51
+
+ if (btrfs_super_magic(&sb) != BTRFS_MAGIC) {
+ ret = -EINVAL;
+ error("bad magic on superblock on %s", device);
+ error("bad superblock magic on %s", device);
+ goto out_close;
+ }
+
+ ret = btrfs_get_extent_csum(fd, &sb);
+ if (ret)
+ error("checsum lookup for file %s failed", filename);
+ error("checksum lookup for file %s failed", filename);
+
+out_close:
+ close(fd);
+ return ret;
Expand Down
4 changes: 4 additions & 0 deletions packages/list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
name = "slurp";
source = ./slurp;
}
{
name = "strace";
source = ./strace;
}
{
name = "tbw";
source = ./tbw;
Expand Down
Loading

0 comments on commit 0e0df38

Please sign in to comment.