format nix files

This commit is contained in:
ChaotiCryptidz 2022-02-15 11:04:08 +00:00
parent 8ae4ad026a
commit 8454cf382e
14 changed files with 84 additions and 102 deletions

View file

@ -6,5 +6,6 @@
"script-opts" = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp"; "script-opts" = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
}; };
}; };
programs.zsh.shellAliases.listen = "${pkgs.mpv}/bin/mpv \"https://music:$(cat /secrets/music-stream-password)@stream.owo.monster/flac\" --cache=yes --cache-pause-initial=yes --cache-pause-wait=5"; programs.zsh.shellAliases.listen = ''
${pkgs.mpv}/bin/mpv "https://music:$(cat /secrets/music-stream-password)@stream.owo.monster/flac" --cache=yes --cache-pause-initial=yes --cache-pause-wait=5'';
} }

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }: {
home.packages = with pkgs; [rofi]; home.packages = with pkgs; [ rofi ];
home.file.".local/share/rofi/themes/rofi-nord.rasi".source = ./rofi-nord.rasi; home.file.".local/share/rofi/themes/rofi-nord.rasi".source = ./rofi-nord.rasi;
home.file.".config/rofi/config.rasi".source = ./config.rasi; home.file.".config/rofi/config.rasi".source = ./config.rasi;
} }

View file

@ -1,3 +1 @@
{ pkgs, inputs, ... }: { { pkgs, inputs, ... }: { home.packages = with pkgs.deploy-rs; [ deploy-rs ]; }
home.packages = with pkgs.deploy-rs; [ deploy-rs ];
}

View file

@ -1,6 +1 @@
{tree, ...}: { { tree, ... }: { imports = with tree; [ home.apps.kitty home.apps.rofi ]; }
imports = with tree; [
home.apps.kitty
home.apps.rofi
];
}

View file

@ -1,7 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let let
usb_data = import ./hardware/usb_data.nix {}; usb_data = import ./hardware/usb_data.nix { };
ssd_data = import ./hardware/ssd_data.nix {}; ssd_data = import ./hardware/ssd_data.nix { };
in { in {
boot = { boot = {
loader = { loader = {
@ -26,32 +26,31 @@ in {
]; ];
kernelModules = [ "kvm-intel" ]; kernelModules = [ "kvm-intel" ];
initrd.postDeviceCommands = pkgs.lib.mkBefore ''
mkdir -m 0755 -p ${usb_data.mountpoint}
initrd.postDeviceCommands = pkgs.lib.mkBefore '' while !(test -b ${usb_data.encrypted_path})
mkdir -m 0755 -p ${usb_data.mountpoint} do
echo "Please Plug In USB"
sleep 1
done
while !(test -b ${usb_data.encrypted_path}) echo "Please Decrypt USB"
do
echo "Please Plug In USB"
sleep 1
done
echo "Please Decrypt USB" cryptsetup luksOpen ${usb_data.encrypted_path} ${usb_data.mapper_name}
cryptsetup luksOpen ${usb_data.encrypted_path} ${usb_data.mapper_name} mount -n -t ${usb_data.unencrypted_fs_type} -o ro ${usb_data.mapper_path} ${usb_data.mountpoint}
'';
mount -n -t ${usb_data.unencrypted_fs_type} -o ro ${usb_data.mapper_path} ${usb_data.mountpoint} initrd.luks.devices = {
''; "${ssd_data.root_mapper_name}" = {
device = "${ssd_data.encrypted_root_path}";
initrd.luks.devices = { keyFile = "${usb_data.lappy_encryption_key_path}";
"${ssd_data.root_mapper_name}" = { preLVM = false;
device = "${ssd_data.encrypted_root_path}"; allowDiscards = true;
keyFile = "${usb_data.lappy_encryption_key_path}"; };
preLVM = false;
allowDiscards = true;
}; };
}; };
};
fileSystems = { fileSystems = {
"/" = { "/" = {

View file

@ -1,23 +1,23 @@
{}: rec { { }: rec {
# Mountpoints # Mountpoints
root_mountpoint = "/"; root_mountpoint = "/";
boot_mountpoint = "/boot"; boot_mountpoint = "/boot";
# Partition Labels # Partition Labels
boot_label = "nixboot"; boot_label = "nixboot";
encrypted_root_partlabel = "nixos_encrypted"; encrypted_root_partlabel = "nixos_encrypted";
# Partition Filesystems # Partition Filesystems
unencrypted_root_fs_type = "ext4"; unencrypted_root_fs_type = "ext4";
boot_fs_type = "vfat"; boot_fs_type = "vfat";
# Mapper Name # Mapper Name
root_mapper_name = "cryptroot"; root_mapper_name = "cryptroot";
# FS Paths # FS Paths
encrypted_root_path = "/dev/disk/by-partlabel/${encrypted_root_partlabel}"; encrypted_root_path = "/dev/disk/by-partlabel/${encrypted_root_partlabel}";
decrypted_root_path = "/dev/mapper/${root_mapper_name}"; decrypted_root_path = "/dev/mapper/${root_mapper_name}";
boot_path = "/dev/disk/by-label/${boot_label}"; boot_path = "/dev/disk/by-label/${boot_label}";
} }

View file

@ -1,24 +1,23 @@
{...}: rec { { ... }: rec {
# Mountpoints # Mountpoints
mountpoint = "/usb"; mountpoint = "/usb";
# Partition Labels # Partition Labels
encrypted_partlabel = "usb"; encrypted_partlabel = "usb";
unencrypted_label = "usb_unencrypted"; unencrypted_label = "usb_unencrypted";
# Partition Filesystems # Partition Filesystems
unencrypted_fs_type = "ext4"; unencrypted_fs_type = "ext4";
# Mapper Information # Mapper Information
mapper_name = "usb_unencrypted"; mapper_name = "usb_unencrypted";
# FS Paths # FS Paths
encrypted_path = "/dev/disk/by-partlabel/${encrypted_partlabel}"; encrypted_path = "/dev/disk/by-partlabel/${encrypted_partlabel}";
unencrypted_path = "/dev/disk/by-label/${unencrypted_label}"; unencrypted_path = "/dev/disk/by-label/${unencrypted_label}";
mapper_path = "/dev/mapper/${mapper_name}"; mapper_path = "/dev/mapper/${mapper_name}";
# Paths to some important files
# Paths to some important files lappy_encryption_key_path = "${mountpoint}/encryption-keys/lappy.key";
lappy_encryption_key_path = "${mountpoint}/encryption-keys/lappy.key";
} }

View file

@ -1,13 +1,11 @@
{lib, inputs, ...}: { { lib, inputs, ... }: {
imports = [ imports = [ "${inputs.nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix" ];
"${inputs.nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix" users.users.root.password = "password";
]; users.users.chaos.password = "password";
users.users.root.password = "password"; home-manager.users.chaos.home.sessionVariables = {
users.users.chaos.password = "password"; WLR_RENDERER_ALLOW_SOFTWARE = "1";
home-manager.users.chaos.home.sessionVariables = { };
WLR_RENDERER_ALLOW_SOFTWARE = "1"; services.getty.extraArgs = lib.mkForce [ ];
}; virtualisation.cores = 4;
services.getty.extraArgs = lib.mkForce []; virtualisation.qemu.options = [ "-vga" "qxl" ];
virtualisation.cores = 4;
virtualisation.qemu.options = ["-vga" "qxl"];
} }

View file

@ -1,9 +1,4 @@
{ lib { lib, stdenv, fetchurl, alsa-topology-conf, alsa-ucm-conf }:
, stdenv
, fetchurl
, alsa-topology-conf
, alsa-ucm-conf
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "alsa-lib"; pname = "alsa-lib";

View file

@ -12,7 +12,6 @@ final: prev: {
}; };
roc-toolkit-patched = final.callPackage ./roc-toolkit-patched { }; roc-toolkit-patched = final.callPackage ./roc-toolkit-patched { };
roc-send-pcm = final.callPackage ./roc-send-pcm { }; roc-send-pcm = final.callPackage ./roc-send-pcm { };
vivaldi = prev.vivaldi.override { vivaldi =
alsa-lib = final.callPackage ./alsa-lib {}; prev.vivaldi.override { alsa-lib = final.callPackage ./alsa-lib { }; };
};
} }

View file

@ -27,7 +27,7 @@
gnomeExtensions.appindicator gnomeExtensions.appindicator
gnome.gnome-tweaks gnome.gnome-tweaks
gnomeExtensions.just-perfection gnomeExtensions.just-perfection
]; ];
services.udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ]; services.udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ];
services.power-profiles-daemon.enable = lib.mkForce false; services.power-profiles-daemon.enable = lib.mkForce false;

View file

@ -1,3 +1 @@
_: { _: { hardware.pulseaudio.daemon.config = { default-sample-rate = "48000"; }; }
hardware.pulseaudio.daemon.config = { default-sample-rate = "48000"; };
}

View file

@ -16,7 +16,8 @@ let
in result != null && builtins.length result > 0; in result != null && builtins.length result > 0;
nixFiles = filterAttrs isNixFile dirContents; nixFiles = filterAttrs isNixFile dirContents;
getPath = entry: "${realPath}/${entry}"; getPath = entry: "${realPath}/${entry}";
getPaths = mapAttrs' (n: v: nameValuePair (removeSuffix ".nix" n) (getPath n)); getPaths =
mapAttrs' (n: v: nameValuePair (removeSuffix ".nix" n) (getPath n));
nixFilePaths = getPaths nixFiles; nixFilePaths = getPaths nixFiles;
dirPaths = getPaths directories; dirPaths = getPaths directories;
recursedPaths = mapAttrs (_: fullPath: recursedPaths = mapAttrs (_: fullPath:
@ -100,12 +101,11 @@ let
let let
processFunctor = prev: processFunctor = prev:
prev // { prev // {
__functor = self: __functor = self: _: {
_: { imports =
imports = attrValues (removeAttrs prev leafConfig.functor.excludes)
attrValues (removeAttrs prev leafConfig.functor.excludes) ++ leafConfig.functor.external;
++ leafConfig.functor.external; };
};
}; };
processAliasDefault = prev: prev.default; processAliasDefault = prev: prev.default;
processDefault = prev: processDefault = prev: