build vm for staff

This commit is contained in:
Noah Masur 2025-03-08 12:58:37 -05:00
parent 350c94af3c
commit 1b05fa3745
No known key found for this signature in database
11 changed files with 102 additions and 58 deletions

View File

@ -22,6 +22,8 @@ in
aarch64-linux-hosts = lib.pipe (lib.filesystem.listFilesRecursive ./aarch64-linux) [
# Get only files ending in default.nix
(builtins.filter (name: lib.hasSuffix "default.nix" name))
# Remove the first file
(builtins.filter (name: name != ./aarch64-linux/default.nix))
# Import each host function
(map (file: {
name = builtins.baseNameOf (builtins.dirOf file);
@ -32,10 +34,10 @@ in
];
x86_64-linux-hosts = lib.pipe (lib.filesystem.listFilesRecursive ./x86_64-linux) [
# Get only files ending in default.nix
(builtins.filter (name: lib.hasSuffix "default.nix" name))
(builtins.filter (name: lib.hasSuffix ".nix" name))
# Import each host function
(map (file: {
name = builtins.baseNameOf (builtins.dirOf file);
name = lib.removeSuffix ".nix" (builtins.baseNameOf file);
value = import file;
}))
# Convert to an attrset of hostname -> host function

View File

@ -1,22 +0,0 @@
# Return a list of all NixOS hosts
{ nixpkgs, ... }:
let
inherit (nixpkgs) lib;
in
lib.pipe (lib.filesystem.listFilesRecursive ./.) [
# Get only files ending in default.nix
(builtins.filter (name: lib.hasSuffix "default.nix" name))
# Remove this file
(builtins.filter (name: name != ./default.nix))
# Import each host function
map
(file: {
name = builtins.baseNameOf (builtins.dirOf file);
value = import file;
})
# Convert to an attrset of hostname -> host function
(builtins.listToAttrs)
]

View File

@ -0,0 +1,62 @@
# The Staff
# System configuration test
rec {
# Hardware
networking.hostName = "staff";
nmasur.settings = {
username = "noah";
fullName = "Noah Masur";
};
nmasur.profiles = {
base.enable = true;
home.enable = true;
gui.enable = true;
};
nmasur.presets.services.cloudflared.enable = false;
home-manager.users."noah" = {
nmasur.settings = {
username = nmasur.settings.username;
fullName = nmasur.settings.fullName;
};
nmasur.profiles = {
common.enable = true;
linux-base.enable = true;
linux-gui.enable = true;
power-user.enable = true;
};
nmasur.presets.services.mbsync = {
user = nmasur.settings.username;
server = "noahmasur.com";
};
home.stateVersion = "23.05";
};
system.stateVersion = "23.05";
# Not sure what's necessary but too afraid to remove anything
# File systems must be declared in order to boot
# This is the root filesystem containing NixOS
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
# This is the boot filesystem for Grub
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
# Allows private remote access over the internet
# nmasur.presets.services.cloudflared = {
# tunnel = {
# id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
# credentialsFile = ../../private/cloudflared-tempest.age;
# ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
# };
# };
}

View File

@ -9,12 +9,12 @@
buildGoModule {
pname = "osc";
version = "v0.4.6";
version = "v0.4.7";
src = fetchFromGitHub {
owner = "theimpostor";
repo = "osc";
rev = "4af7c8e54ecc499097121909f02ecb42a8a60d24";
sha256 = lib.fakeSha256;
rev = "c8e1e2f42a5d5fb628eaa48e889bde578deb8d33";
sha256 = "sha256-MfEBbYT99tEtlOMmdl3iq2d07KYsN1tu5tDRFW3676g=";
};
vendorHash = "sha256-POtQWIjPObsfa3YZ1dLZgedZFUcc4HeTWjU20AucoKc=";

View File

@ -0,0 +1,13 @@
{ pkgs, ... }:
pkgs.rustPlatform.buildRustPackage {
pname = "ren-find";
version = "0.0.7";
src = pkgs.fetchFromGitHub {
owner = "robenkleene";
repo = "ren-find";
rev = "50c40172e354caffee48932266edd7c7a76a20fd";
sha256 = "sha256-zVIt6Xp+Mvym6gySvHIZJt1QgzKVP/wbTGTubWk6kzI=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-lSeO/GaJPZ8zosOIJRXVIEuPXaBg1GBvKBIuXtu1xZg=";
}

View File

@ -1,12 +0,0 @@
{ pkgs, ... }:
pkgs.rustPlatform.buildRustPackage {
pname = "ren-find";
version = "0.0.7";
src = pkgs.fetchFromGitHub {
owner = "robenkleene";
repo = "ren-find";
rev = "4af7c8e54ecc499097121909f02ecb42a8a60d24";
sha256 = pkgs.lib.fakeHash;
};
cargoHash = "sha256-3bI3j2xvNHp4kyLEq/DZvRJBF2rn6pE4n8oXh67edDI=";
}

View File

@ -0,0 +1,13 @@
{ pkgs, ... }:
pkgs.rustPlatform.buildRustPackage {
pname = "rep-grep";
version = "0.0.7";
src = pkgs.fetchFromGitHub {
owner = "robenkleene";
repo = "rep-grep";
rev = "2a24f95170aa14b5182b2287125664a62f8688ef";
sha256 = "sha256-gBxrbGCy6JEHnmgJmcm8sgtEvCAqra8/gPGsfCEfLqg=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-t4tfQaFq4EV4ZWeU+IestSFiSAIeVQslTZhLbpKVoO4=";
}

View File

@ -1,12 +0,0 @@
{ pkgs, ... }:
pkgs.rustPlatform.buildRustPackage {
pname = "rep-grep";
version = "0.0.7";
src = pkgs.fetchFromGitHub {
owner = "robenkleene";
repo = "rep-grep";
rev = "4af7c8e54ecc499097121909f02ecb42a8a60d24";
sha256 = pkgs.lib.fakeHash;
};
cargoHash = "sha256-GEr3VvQ0VTKHUbW/GFEgwLpQWP2ZhS/4KYjDvfFLgxo=";
}

View File

@ -21,8 +21,8 @@ in
pkgs.jo # JSON output
pkgs.nmasur.osc # Clipboard over SSH
pkgs.qrencode # Generate qr codes
pkgs.ren # Rename files
pkgs.rep # Replace text in files
pkgs.nmasur.ren-find # Rename files
pkgs.nmasur.rep-grep # Replace text in files
pkgs.spacer # Output lines in terminal
pkgs.tealdeer # Cheatsheets
pkgs.vimv-rs # Batch rename files
@ -37,16 +37,16 @@ in
];
programs.fish.shellAliases = {
"cd" = lib.mkDefault lib.getExe pkgs.zoxide;
"du" = lib.mkDefault lib.getExe pkgs.dua;
"ncdu" = lib.mkDefault lib.getExe pkgs.du-dust;
"df" = lib.mkDefault lib.getExe pkgs.duf;
"cd" = lib.mkDefault (lib.getExe pkgs.zoxide);
"du" = lib.mkDefault (lib.getExe pkgs.dua);
"ncdu" = lib.mkDefault (lib.getExe pkgs.du-dust);
"df" = lib.mkDefault (lib.getExe pkgs.duf);
# Use eza (exa) instead of ls for fancier output
ls = lib.mkDefault "${lib.getExe pkgs.eza} --group";
# Version of bash which works much better on the terminal
bash = lib.mkDefault lib.getExe pkgs.bashInteractive;
bash = lib.mkDefault (lib.getExe pkgs.bashInteractive);
};
nmasur.presets.programs = {