pull/5/head
pegasust 2023-01-12 23:42:21 -07:00
parent 3a3683baa9
commit 2176df3047
57 changed files with 687 additions and 587 deletions

View File

@ -6,7 +6,8 @@
# It should not contain PDE # It should not contain PDE
{ pkgs ? import <nixpkgs> { } { pkgs ? import <nixpkgs> { }
, lib , lib
,...}: pkgs.mkShell { , ...
}: pkgs.mkShell {
# mkShell doesn't care about the differences across nativeBuildInputs, # mkShell doesn't care about the differences across nativeBuildInputs,
# buildInputs, or packages # buildInputs, or packages
buildInputs = [ buildInputs = [

View File

@ -123,5 +123,6 @@
debug = { debug = {
inherit final_inputs hosts users modules lib inputs_w_lib unit_tests pkgs nixpkgs; inherit final_inputs hosts users modules lib inputs_w_lib unit_tests pkgs nixpkgs;
}; };
formatter."${system}" = pkgs.nixpkgs-fmt;
}; };
} }

View File

@ -1,5 +1,12 @@
{nixpkgs, agenix, home-manager, flake-utils, nixgl, rust-overlay, flake-compat { nixpkgs
,pkgs, lib, proj_root}: { , agenix
, home-manager
} , flake-utils
, nixgl
, rust-overlay
, flake-compat
, pkgs
, lib
, proj_root
}: { }

View File

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -17,13 +18,15 @@
fileSystems."/" = fileSystems."/" =
# Might be wise to use /dev/nvme0p1 instead # Might be wise to use /dev/nvme0p1 instead
{ device = "/dev/disk/by-uuid/27fc09b3-e3b7-4883-94a0-c313a0e0abe2"; {
device = "/dev/disk/by-uuid/27fc09b3-e3b7-4883-94a0-c313a0e0abe2";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
# Might be wise to use /dev/nvme0p2 instead # Might be wise to use /dev/nvme0p2 instead
{ device = "/dev/disk/by-uuid/EBA6-394D"; {
device = "/dev/disk/by-uuid/EBA6-394D";
fsType = "vfat"; fsType = "vfat";
}; };

View File

@ -1,5 +1,18 @@
{nixpkgs, agenix, home-manager, flake-utils, nixgl, rust-overlay, flake-compat { nixpkgs
,pkgs, lib, proj_root, nixosDefaultVersion? "22.05", defaultSystem? "x86_64-linux",...}@finalInputs: let , agenix
, home-manager
, flake-utils
, nixgl
, rust-overlay
, flake-compat
, pkgs
, lib
, proj_root
, nixosDefaultVersion ? "22.05"
, defaultSystem ? "x86_64-linux"
, ...
}@finalInputs:
let
config = { config = {
bao.metadata = { bao.metadata = {
# req # req
@ -20,7 +33,8 @@ config = {
]; ];
}; };
}; };
propagate = hostConfig@{metadata, nixosConfig}: let propagate = hostConfig@{ metadata, nixosConfig }:
let
# req # req
inherit (metadata) hostName; inherit (metadata) hostName;
# opts # opts
@ -33,7 +47,8 @@ propagate = hostConfig@{metadata, nixosConfig}: let
hardwareConfig = import "${proj_root.hosts.path}/${hostName}/hardware-configuration.nix"; hardwareConfig = import "${proj_root.hosts.path}/${hostName}/hardware-configuration.nix";
# alias to prevent infinite recursion # alias to prevent infinite recursion
_nixosConfig = nixosConfig; _nixosConfig = nixosConfig;
in { in
{
inherit hostName ssh_pubkey users nixosVersion system preset hardwareConfig; inherit hostName ssh_pubkey users nixosVersion system preset hardwareConfig;
nixosConfig = _nixosConfig // { nixosConfig = _nixosConfig // {
inherit system; inherit system;

View File

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/profiles/qemu-guest.nix") [
(modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ];
@ -23,13 +24,13 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/sda"; {
device = "/dev/sda";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = swapDevices =
[ { device = "/dev/sdb"; } [{ device = "/dev/sdb"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -1,4 +1,11 @@
{nixpkgs, agenix, home-manager, flake-utils, nixgl, rust-overlay, flake-compat { nixpkgs
,pkgs, lib, proj_root}: { , agenix
, home-manager
} , flake-utils
, nixgl
, rust-overlay
, flake-compat
, pkgs
, lib
, proj_root
}: { }

View File

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/profiles/qemu-guest.nix") [
(modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ];
@ -23,13 +24,13 @@
boot.loader.grub.device = "nodev"; boot.loader.grub.device = "nodev";
boot.loader.timeout = 10; boot.loader.timeout = 10;
fileSystems."/" = fileSystems."/" =
{ device = "/dev/sda"; {
device = "/dev/sda";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = swapDevices =
[ { device = "/dev/sdb"; } [{ device = "/dev/sdb"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -0,0 +1 @@

View File

@ -4,20 +4,25 @@
# ,agenix # ,agenix
, nixosDefaultVersion ? "22.05" , nixosDefaultVersion ? "22.05"
, defaultSystem ? "x86_64-linux" , defaultSystem ? "x86_64-linux"
,...}@inputs: let , ...
}@inputs:
let
lib = pkgs.lib; lib = pkgs.lib;
inputs_w_lib = (inputs // { inherit lib; }); inputs_w_lib = (inputs // { inherit lib; });
serde = import ./serde.nix inputs_w_lib; serde = import ./serde.nix inputs_w_lib;
shellAsDrv = {script, pname}: (pkgs.callPackage ( shellAsDrv = { script, pname }: (pkgs.callPackage
(
# just a pattern that we must remember: args to this are children of pkgs. # just a pattern that we must remember: args to this are children of pkgs.
{ writeShellScriptBin }: writeShellScriptBin pname script { writeShellScriptBin }: writeShellScriptBin pname script
) {}); )
{ });
trimNull = lib.filterAttrs (name: value: value != null); trimNull = lib.filterAttrs (name: value: value != null);
# ssh # ssh
flattenPubkey = lib.mapAttrs (_identity: meta_config: lib.attrByPath [ "metadata" "ssh_pubkey" ] null meta_config); flattenPubkey = lib.mapAttrs (_identity: meta_config: lib.attrByPath [ "metadata" "ssh_pubkey" ] null meta_config);
getPubkey = config: (lib.pipe config [ flattenPubkey trimNull ]); getPubkey = config: (lib.pipe config [ flattenPubkey trimNull ]);
# procedure = # procedure =
in { in
{
# short-hand to create a shell derivation # short-hand to create a shell derivation
# NOTE: this is pure. This means, env vars from devShells might not # NOTE: this is pure. This means, env vars from devShells might not
# be accessible unless MAYBE they are `export`ed # be accessible unless MAYBE they are `export`ed

View File

@ -16,13 +16,15 @@ let
echo "$yamlContent" | yq >$out echo "$yamlContent" | yq >$out
'') '')
{ }; { };
in { in
{
# Takes in a yaml string and produces a derivation with translated JSON at $outputPath # Takes in a yaml string and produces a derivation with translated JSON at $outputPath
# similar to builtins.fromJSON, turns a YAML string to nix attrset # similar to builtins.fromJSON, turns a YAML string to nix attrset
fromYaml = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlContent "any_output.json")); fromYaml = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlContent "any_output.json"));
fromYamlPath = yamlPath: builtins.fromJSON ( fromYamlPath = yamlPath: builtins.fromJSON (
builtins.readFile ( builtins.readFile (
yamlToJsonDrv ( yamlToJsonDrv
(
builtins.readFile yamlPath) builtins.readFile yamlPath)
"any-output.json")); "any-output.json"));
# TODO: fromToml? # TODO: fromToml?

View File

@ -1,3 +1 @@
{lib,...}: { { lib, ... }: { }
}

View File

@ -5,9 +5,11 @@
# openCL # openCL
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
extraPackages = let extraPackages =
let
inherit (pkgs) rocm-opencl-icd rocm-opencl-runtime; inherit (pkgs) rocm-opencl-icd rocm-opencl-runtime;
in [rocm-opencl-icd rocm-opencl-runtime]; in
[ rocm-opencl-icd rocm-opencl-runtime ];
# Vulkan # Vulkan
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
@ -15,4 +17,5 @@
package32 = pkgs.pkgsi686Linux.mesa.drivers; package32 = pkgs.pkgsi686Linux.mesa.drivers;
}; };
}; };
in; in
;

View File

@ -1,5 +1,6 @@
{ proj_root { proj_root
,...}: { , ...
}: {
age.secrets.s3fs = { age.secrets.s3fs = {
file = "${proj_root.secrets.path}/s3fs.age"; file = "${proj_root.secrets.path}/s3fs.age";
# mode = "600"; # owner + group only # mode = "600"; # owner + group only

View File

@ -70,7 +70,8 @@
bucket = "digital-garden"; bucket = "digital-garden";
}) })
( (
let args = { let
args = {
"-fstype" = "cifs"; "-fstype" = "cifs";
credentials = config.age.secrets._nhitrl_cred.path; credentials = config.age.secrets._nhitrl_cred.path;
user = null; user = null;
@ -79,10 +80,12 @@
dir_mode = "0777"; dir_mode = "0777";
file_mode = "0777"; file_mode = "0777";
}; };
in "felia_d ${confToBackendArg args} ://felia.coati-celsius.ts.net/d" in
"felia_d ${confToBackendArg args} ://felia.coati-celsius.ts.net/d"
) )
( (
let args = { let
args = {
"-fstype" = "cifs"; "-fstype" = "cifs";
credentials = config.age.secrets._nhitrl_cred.path; credentials = config.age.secrets._nhitrl_cred.path;
user = null; user = null;
@ -91,7 +94,8 @@
dir_mode = "0777"; dir_mode = "0777";
file_mode = "0777"; file_mode = "0777";
}; };
in "felia_f ${confToBackendArg args} ://felia.coati-celsius.ts.net/f" in
"felia_f ${confToBackendArg args} ://felia.coati-celsius.ts.net/f"
) )
]; ];
persoConf = pkgs.writeText "auto.personal" (builtins.concatStringsSep "\n" personalStorage); persoConf = pkgs.writeText "auto.personal" (builtins.concatStringsSep "\n" personalStorage);

View File

@ -1,7 +1,8 @@
{ pkgs { pkgs
, config , config
, lib , lib
,...}: { , ...
}: {
environment.systemPackages = [ pkgs.tailscale ]; environment.systemPackages = [ pkgs.tailscale ];
services.tailscale.enable = true; services.tailscale.enable = true;

View File

@ -36,7 +36,18 @@
, ... , ...
}: }:
let let
system = "x86_64-linux"; # config_fn:: system -> config
cross_platform = config_fn: ({
packages = builtins.foldl'
(prev: system: prev // {
"${system}" = config_fn system;
})
{ }
flake-utils.lib.defaultSystems;
});
in
cross_platform (system:
let
overlays = import ./../../overlays.nix flake_inputs; overlays = import ./../../overlays.nix flake_inputs;
# pkgs = nixpkgs.legacyPackages.${system}.appendOverlays overlays; # pkgs = nixpkgs.legacyPackages.${system}.appendOverlays overlays;
pkgs = import nixpkgs { pkgs = import nixpkgs {
@ -62,13 +73,14 @@
inherit overlays pkgs base; inherit overlays pkgs base;
}; };
homeConfigurations = homeConfigurations =
let x11_wsl = '' let
x11_wsl = ''
# x11 output for WSL # x11 output for WSL
export DISPLAY=$(ip route list default | awk '{print $3}'):0 export DISPLAY=$(ip route list default | awk '{print $3}'):0
export LIBGL_ALWAYS_INDIRECT=1 export LIBGL_ALWAYS_INDIRECT=1
''; '';
in in
rec { {
"hungtr" = home-manager.lib.homeManagerConfiguration { "hungtr" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = base.modules ++ [ modules = base.modules ++ [
@ -109,6 +121,7 @@
}; };
}; };
}; };
"htran" = home-manager.lib.homeManagerConfiguration { };
"nixos@Felia" = home-manager.lib.homeManagerConfiguration { "nixos@Felia" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
@ -174,5 +187,5 @@
}; };
}; };
}; };
}; });
} }

View File

@ -6,13 +6,15 @@
flake = false; flake = false;
}; };
}; };
outputs = {nixpkgs,from-yaml, ...}: let outputs = { nixpkgs, from-yaml, ... }:
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
lib = { lib = {
fromYaml = import "${from-yaml}/fromYaml.nix" { lib = pkgs.lib; }; fromYaml = import "${from-yaml}/fromYaml.nix" { lib = pkgs.lib; };
}; };
in { in
{
inherit nixpkgs; inherit nixpkgs;
inherit from-yaml; inherit from-yaml;
inherit lib; inherit lib;

View File

@ -0,0 +1 @@

View File

@ -1,7 +1,9 @@
{ pkgs { pkgs
, lib ? pkgs.lib , lib ? pkgs.lib
, ... }@flake_import: , ...
let serde = import ./serde { inherit pkgs lib; }; }@flake_import:
let
serde = import ./serde { inherit pkgs lib; };
recursiveUpdate = lib.recursiveUpdate; recursiveUpdate = lib.recursiveUpdate;
in in
recursiveUpdate (recursiveUpdate pkgs.lib lib) { recursiveUpdate (recursiveUpdate pkgs.lib lib) {

View File

@ -15,13 +15,15 @@ let
echo "$yamlContent" | yq >$out echo "$yamlContent" | yq >$out
'') '')
{ }; { };
in { in
{
# Takes in a yaml string and produces a derivation with translated JSON at $outputPath # Takes in a yaml string and produces a derivation with translated JSON at $outputPath
# similar to builtins.fromJSON, turns a YAML string to nix attrset # similar to builtins.fromJSON, turns a YAML string to nix attrset
fromYaml = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlContent "any_output.json")); fromYaml = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlContent "any_output.json"));
fromYamlPath = yamlPath: builtins.fromJSON ( fromYamlPath = yamlPath: builtins.fromJSON (
builtins.readFile ( builtins.readFile (
yamlToJsonDrv ( yamlToJsonDrv
(
builtins.readFile yamlPath) builtins.readFile yamlPath)
"any-output.json")); "any-output.json"));
# TODO: fromToml? # TODO: fromToml?

View File

@ -10,7 +10,8 @@ let
all = users // systems; all = users // systems;
# stands for calculus # stands for calculus
c_ = builtins; c_ = builtins;
in { in
{
"system/secrets/s3fs.age".publicKeys = c_.attrValues (all); "system/secrets/s3fs.age".publicKeys = c_.attrValues (all);
"system/secrets/s3fs.digital-garden.age".publicKeys = c_.attrValues (all); "system/secrets/s3fs.digital-garden.age".publicKeys = c_.attrValues (all);
"system/secrets/_nhitrl.age".publicKeys = c_.attrValues (all); "system/secrets/_nhitrl.age".publicKeys = c_.attrValues (all);

View File

@ -30,7 +30,8 @@
environment.systemPackages = [ agenix.defaultPackage.x86_64-linux ]; environment.systemPackages = [ agenix.defaultPackage.x86_64-linux ];
} }
]; ];
in { in
{
# Windows with NixOS WSL # Windows with NixOS WSL
nixosConfigurations.Felia = nixpkgs.lib.nixosSystem { nixosConfigurations.Felia = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -218,9 +219,11 @@
# openCL # openCL
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
extraPackages = let extraPackages =
let
inherit (pkgs) rocm-opencl-icd rocm-opencl-runtime; inherit (pkgs) rocm-opencl-icd rocm-opencl-runtime;
in [rocm-opencl-icd rocm-opencl-runtime]; in
[ rocm-opencl-icd rocm-opencl-runtime ];
# Vulkan # Vulkan
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;

View File

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/profiles/qemu-guest.nix") [
(modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ];
@ -23,13 +24,13 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/sda"; {
device = "/dev/sda";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = swapDevices =
[ { device = "/dev/sdb"; } [{ device = "/dev/sdb"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
@ -16,13 +17,15 @@
fileSystems."/" = fileSystems."/" =
# Might be wise to use /dev/nvme0p1 instead # Might be wise to use /dev/nvme0p1 instead
{ device = "/dev/disk/by-uuid/27fc09b3-e3b7-4883-94a0-c313a0e0abe2"; {
device = "/dev/disk/by-uuid/27fc09b3-e3b7-4883-94a0-c313a0e0abe2";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
# Might be wise to use /dev/nvme0p2 instead # Might be wise to use /dev/nvme0p2 instead
{ device = "/dev/disk/by-uuid/EBA6-394D"; {
device = "/dev/disk/by-uuid/EBA6-394D";
fsType = "vfat"; fsType = "vfat";
}; };

View File

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/profiles/qemu-guest.nix") [
(modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ];
@ -23,13 +24,13 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/sda"; {
device = "/dev/sda";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = swapDevices =
[ { device = "/dev/sdb"; } [{ device = "/dev/sdb"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/profiles/qemu-guest.nix") [
(modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ];
@ -23,13 +24,13 @@
boot.loader.grub.device = "nodev"; boot.loader.grub.device = "nodev";
boot.loader.timeout = 10; boot.loader.timeout = 10;
fileSystems."/" = fileSystems."/" =
{ device = "/dev/sda"; {
device = "/dev/sda";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = swapDevices =
[ { device = "/dev/sdb"; } [{ device = "/dev/sdb"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -1,24 +1,25 @@
{ ## Nvidia informations. {
## Nvidia informations.
# Version of the system kernel module. Let it to null to enable auto-detection. # Version of the system kernel module. Let it to null to enable auto-detection.
nvidiaVersion ? null, nvidiaVersion ? null
# Hash of the Nvidia driver .run file. null is fine, but fixing a value here , # Hash of the Nvidia driver .run file. null is fine, but fixing a value here
# will be more reproducible and more efficient. # will be more reproducible and more efficient.
nvidiaHash ? null, nvidiaHash ? null
# Alternatively, you can pass a path that points to a nvidia version file , # Alternatively, you can pass a path that points to a nvidia version file
# and let nixGL extract the version from it. That file must be a copy of # and let nixGL extract the version from it. That file must be a copy of
# /proc/driver/nvidia/version. Nix doesn't like zero-sized files (see # /proc/driver/nvidia/version. Nix doesn't like zero-sized files (see
# https://github.com/NixOS/nix/issues/3539 ). # https://github.com/NixOS/nix/issues/3539 ).
nvidiaVersionFile ? null, nvidiaVersionFile ? null
# Enable 32 bits driver , # Enable 32 bits driver
# This is on by default, you can switch it to off if you want to reduce a # This is on by default, you can switch it to off if you want to reduce a
# bit the size of nixGL closure. # bit the size of nixGL closure.
enable32bits ? true, enable32bits ? true
# Make sure to enable config.allowUnfree to the instance of nixpkgs to be , # Make sure to enable config.allowUnfree to the instance of nixpkgs to be
# able to access the nvidia drivers. # able to access the nvidia drivers.
pkgs ? import <nixpkgs> { pkgs ? import <nixpkgs> {
config = { allowUnfree = true; }; config = { allowUnfree = true; };
}, }
# Enable all Intel specific extensions which only works on x86_64 , # Enable all Intel specific extensions which only works on x86_64
enableIntelX86Extensions ? true enableIntelX86Extensions ? true
}: }:
pkgs.callPackage ./nixGL.nix ({ pkgs.callPackage ./nixGL.nix ({

View File

@ -14,7 +14,8 @@
enable32bits = isIntelX86Platform; enable32bits = isIntelX86Platform;
enableIntelX86Extensions = isIntelX86Platform; enableIntelX86Extensions = isIntelX86Platform;
}; };
in rec { in
rec {
packages = { packages = {
# makes it easy to use "nix run nixGL --impure -- program" # makes it easy to use "nix run nixGL --impure -- program"

View File

@ -13,7 +13,8 @@ let
inherit (pubKeys) users hosts; inherit (pubKeys) users hosts;
all = users // hosts; all = users // hosts;
c_ = builtins; c_ = builtins;
in { in
{
"secrets/s3fs.age".publicKeys = c_.attrValues (all); "secrets/s3fs.age".publicKeys = c_.attrValues (all);
"secrets/s3fs.digital-garden.age".publicKeys = c_.attrValues (all); "secrets/s3fs.digital-garden.age".publicKeys = c_.attrValues (all);
"secrets/_nhitrl.age".publicKeys = c_.attrValues (all); "secrets/_nhitrl.age".publicKeys = c_.attrValues (all);

View File

@ -1,5 +1,6 @@
# TODO: put ssh keys as user/host config # TODO: put ssh keys as user/host config
inputs: let inputs:
let
# user-specific (~/.ssh/id_ed25519.pub) # user-specific (~/.ssh/id_ed25519.pub)
users = { users = {
"hungtr@bao" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+1+gps6phbZboIb9fH51VNPUCkhSSOAbkI3tq3Ou0Z"; "hungtr@bao" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+1+gps6phbZboIb9fH51VNPUCkhSSOAbkI3tq3Ou0Z";
@ -11,7 +12,8 @@ inputs: let
all = users // systems; all = users // systems;
# stands for calculus # stands for calculus
c_ = builtins; c_ = builtins;
in { in
{
"system/secrets/s3fs.age".publicKeys = c_.attrValues (all); "system/secrets/s3fs.age".publicKeys = c_.attrValues (all);
"system/secrets/s3fs.digital-garden.age".publicKeys = c_.attrValues (all); "system/secrets/s3fs.digital-garden.age".publicKeys = c_.attrValues (all);
"system/secrets/_nhitrl.age".publicKeys = c_.attrValues (all); "system/secrets/_nhitrl.age".publicKeys = c_.attrValues (all);

View File

@ -1,7 +1,10 @@
(import ( (import
(
fetchTarball { fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; } sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
) { }
)
{
src = ./.; src = ./.;
}).defaultNix }).defaultNix

View File

@ -1,7 +1,10 @@
(import ( (import
(
fetchTarball { fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; } sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
) { }
)
{
src = ./.; src = ./.;
}).shellNix }).shellNix

View File

@ -1,7 +1,10 @@
(import ( (import
(
fetchTarball { fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; } sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
) { }
)
{
src = ./.; src = ./.;
}).defaultNix }).defaultNix

View File

@ -1,7 +1,10 @@
(import ( (import
(
fetchTarball { fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; } sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
) { }
)
{
src = ./.; src = ./.;
}).shellNix }).shellNix

View File

@ -1,12 +1,13 @@
{lib,...}@inputs: let { lib, ... }@inputs:
let
config = { config = {
hungtr.metadata = { hungtr.metadata = { };
};
"hungtr@bao".metadata = { "hungtr@bao".metadata = {
ssh_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+1+gps6phbZboIb9fH51VNPUCkhSSOAbkI3tq3Ou0Z"; ssh_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+1+gps6phbZboIb9fH51VNPUCkhSSOAbkI3tq3Ou0Z";
}; };
}; };
in { in
{
homeConfigurations = { }; homeConfigurations = { };
pubKeys = lib.getPubkey config; pubKeys = lib.getPubkey config;
} }