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-rasi": "tree-sitter-rasi",
"tree-sitter-vimdoc": "tree-sitter-vimdoc",
"wallpapers": "wallpapers",
"wsl": "wsl",
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
}
@ -810,22 +809,6 @@
"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": {
"inputs": {
"flake-compat": "flake-compat_2",

View File

@ -52,11 +52,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
# Wallpapers
wallpapers = {
url = "gitlab:exorcist365/wallpapers";
flake = false;
};
# # Wallpapers
# wallpapers = {
# url = "gitlab:exorcist365/wallpapers";
# flake = false;
# };
# Used to generate NixOS images for other platforms
nixos-generators = {
@ -295,9 +295,9 @@
inputs.wsl.nixosModules.wsl
./platforms/nixos
];
specialArgs = {
wallpapers = inputs.wallpapers;
};
# specialArgs = {
# wallpapers = inputs.wallpapers;
# };
};
buildDarwin =
@ -320,7 +320,8 @@
# Create nixosConfigurations using the different pkgs for each system
# 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
# nixos-rebuild switch --flake .#tempest
@ -350,24 +351,27 @@
# Contains my full Mac system builds, including home-manager
# darwin-rebuild switch --flake .#lookingglass
darwinConfigurations = builtins.mapAttrs buildDarwin {
pkgs = pkgsBySystem.aarch64-darwin;
modules = import ./hosts/darwin;
};
darwinConfigurations = builtins.mapAttrs (
name: module:
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:
# home-manager switch --flake .#tempest
homeConfigurations = rec {
default = personal;
work = buildHome {
pkgs = pkgsBySystem.aarch64-darwin;
modules = { };
};
personal = buildHome {
};
tempest = nixosConfigurations.tempest.config.home-manager.users.${globals.user}.home;
lookingglass = darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
};
homeConfigurations = builtins.mapAttrs (
name: module:
buildHome {
pkgs = pkgsBySystem.x86_64-linux;
module = [ module ];
}
) nixosModules;
# Disk formatting, only used once
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
{
darwin-hosts = import ./aarch64-darwin;
linux-hosts = import ./x86_64-linux // import ./aarch64-linux;
darwin-hosts = import ./darwin;
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.writeShellApplication
{
name = "ocr";
runtimeInputs = [ pkgs.tesseract ];
text = builtins.readFile ./ocr.sh;
}
pkgs.stdenv.mkDerivation {
pname = "wallpapers";
version = "0.1";
src = pkgs.fetchFromGitLab {
owner = "exorcist365";
repo = "wallpapers";
rev = "8d2860ac6c05cec0f78d5c9d07510f4ff5da90dc";
sha256 = "155lb7w563dk9kdn4752hl0zjhgnq3j4cvs9z98nb25k1xpmpki7";
};
installPhase = ''
cp -r $src/ $out/
'';
}

View File

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

View File

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