more moving around

This commit is contained in:
Noah Masur 2025-02-16 16:17:39 -05:00
parent dc6b6f8328
commit 1062369a78
No known key found for this signature in database
12 changed files with 81 additions and 53 deletions

17
flake.lock generated
View File

@ -557,7 +557,6 @@
"tree-sitter-python": "tree-sitter-python", "tree-sitter-python": "tree-sitter-python",
"tree-sitter-rasi": "tree-sitter-rasi", "tree-sitter-rasi": "tree-sitter-rasi",
"tree-sitter-vimdoc": "tree-sitter-vimdoc", "tree-sitter-vimdoc": "tree-sitter-vimdoc",
"wallpapers": "wallpapers",
"wsl": "wsl", "wsl": "wsl",
"zenyd-mpv-scripts": "zenyd-mpv-scripts" "zenyd-mpv-scripts": "zenyd-mpv-scripts"
} }
@ -810,22 +809,6 @@
"type": "github" "type": "github"
} }
}, },
"wallpapers": {
"flake": false,
"locked": {
"lastModified": 1657544922,
"narHash": "sha256-1c1uDz37MhksWC75myv6jao5q2mIzD8X8I+TykXXmWg=",
"owner": "exorcist365",
"repo": "wallpapers",
"rev": "8d2860ac6c05cec0f78d5c9d07510f4ff5da90dc",
"type": "gitlab"
},
"original": {
"owner": "exorcist365",
"repo": "wallpapers",
"type": "gitlab"
}
},
"wsl": { "wsl": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",

View File

@ -52,11 +52,11 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Wallpapers # # Wallpapers
wallpapers = { # wallpapers = {
url = "gitlab:exorcist365/wallpapers"; # url = "gitlab:exorcist365/wallpapers";
flake = false; # flake = false;
}; # };
# Used to generate NixOS images for other platforms # Used to generate NixOS images for other platforms
nixos-generators = { nixos-generators = {
@ -295,9 +295,9 @@
inputs.wsl.nixosModules.wsl inputs.wsl.nixosModules.wsl
./platforms/nixos ./platforms/nixos
]; ];
specialArgs = { # specialArgs = {
wallpapers = inputs.wallpapers; # wallpapers = inputs.wallpapers;
}; # };
}; };
buildDarwin = buildDarwin =
@ -320,7 +320,8 @@
# Create nixosConfigurations using the different pkgs for each system # Create nixosConfigurations using the different pkgs for each system
# What to do with home config? # What to do with home config?
nixosModules = import ./hosts/x86_64-linux nixpkgs // import ./hosts/aarch64-linux nixpkgs; nixosModules = import ./hosts/nixos nixpkgs;
darwinModules = import ./hosts/darwin nixpkgs;
# Contains my full system builds, including home-manager # Contains my full system builds, including home-manager
# nixos-rebuild switch --flake .#tempest # nixos-rebuild switch --flake .#tempest
@ -350,24 +351,27 @@
# Contains my full Mac system builds, including home-manager # Contains my full Mac system builds, including home-manager
# darwin-rebuild switch --flake .#lookingglass # darwin-rebuild switch --flake .#lookingglass
darwinConfigurations = builtins.mapAttrs buildDarwin { darwinConfigurations = builtins.mapAttrs (
pkgs = pkgsBySystem.aarch64-darwin; name: module:
modules = import ./hosts/darwin; buildDarwin {
}; pkgs = pkgsBySystem.aarch64-darwin;
modules = [ module ];
}
) darwinModules;
# darwinConfigurations = builtins.mapAttrs buildDarwin {
# pkgs = pkgsBySystem.aarch64-darwin;
# modules = import ./hosts/darwin;
# };
# For quickly applying home-manager settings with: # For quickly applying home-manager settings with:
# home-manager switch --flake .#tempest # home-manager switch --flake .#tempest
homeConfigurations = rec { homeConfigurations = builtins.mapAttrs (
default = personal; name: module:
work = buildHome { buildHome {
pkgs = pkgsBySystem.aarch64-darwin; pkgs = pkgsBySystem.x86_64-linux;
modules = { }; module = [ module ];
}; }
personal = buildHome { ) nixosModules;
};
tempest = nixosConfigurations.tempest.config.home-manager.users.${globals.user}.home;
lookingglass = darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
};
# Disk formatting, only used once # Disk formatting, only used once
diskoConfigurations = { diskoConfigurations = {

16
hosts/darwin/default.nix Normal file
View File

@ -0,0 +1,16 @@
# Return a list of all nix-darwin hosts
{ lib, ... }:
lib.pipe (lib.filesystem.listFilesRecursive ./.) [
# Get only files ending in default.nix
(builtins.filter (name: lib.hasSuffix "default.nix" name))
# 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

@ -1,6 +1,6 @@
# Return a list of all hosts # Return a list of all hosts
{ {
darwin-hosts = import ./aarch64-darwin; darwin-hosts = import ./darwin;
linux-hosts = import ./x86_64-linux // import ./aarch64-linux; linux-hosts = import ./nixos;
} }

20
hosts/nixos/default.nix Normal file
View File

@ -0,0 +1,20 @@
# 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))
# 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

@ -1,10 +1,15 @@
{ pkgs, ... }: { pkgs, ... }:
pkgs. pkgs.stdenv.mkDerivation {
pname = "wallpapers";
pkgs.writeShellApplication version = "0.1";
{ src = pkgs.fetchFromGitLab {
name = "ocr"; owner = "exorcist365";
runtimeInputs = [ pkgs.tesseract ]; repo = "wallpapers";
text = builtins.readFile ./ocr.sh; rev = "8d2860ac6c05cec0f78d5c9d07510f4ff5da90dc";
} sha256 = "155lb7w563dk9kdn4752hl0zjhgnq3j4cvs9z98nb25k1xpmpki7";
};
installPhase = ''
cp -r $src/ $out/
'';
}

View File

@ -20,6 +20,7 @@ in
wallpaper = { wallpaper = {
type = lib.types.path; type = lib.types.path;
description = "Wallpaper background image file"; description = "Wallpaper background image file";
default = "${pkgs.wallpapers}/gruvbox/road.jpg";
}; };
commands = { commands = {
launcher = lib.mkOption { launcher = lib.mkOption {

View File

@ -2,7 +2,6 @@
config, config,
pkgs, pkgs,
lib, lib,
wallpapers ? null,
... ...
}: }:
@ -17,7 +16,7 @@ in
wallpaper = { wallpaper = {
type = lib.types.nullOr lib.types.path; type = lib.types.nullOr lib.types.path;
description = "Wallpaper background image file"; description = "Wallpaper background image file";
default = "${wallpapers}/gruvbox/road.jpg"; default = "${pkgs.wallpapers}/gruvbox/road.jpg";
}; };
gtk.theme = { gtk.theme = {
name = lib.mkOption { name = lib.mkOption {