Tearin' it up

This commit is contained in:
Daniel Flanagan 2024-02-20 17:19:08 -06:00
parent 4da7f66fa5
commit 97fcd6a9e5
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
9 changed files with 123 additions and 123 deletions

View file

@ -230,6 +230,22 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1708296515,
"narHash": "sha256-FyF489fYNAUy7b6dkYV6rGPyzp+4tThhr80KNAaF/yY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b98a4e1746acceb92c509bc496ef3d0e5ad8d4aa",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"api-lyte-dev": "api-lyte-dev",
@ -308,9 +324,7 @@
},
"ssbm": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs": "nixpkgs_3",
"slippi-desktop": "slippi-desktop"
},
"locked": {

View file

@ -6,7 +6,7 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs";
helix.url = "github:helix-editor/helix/master";
# I think if I force this to follow nixpkgs, I won't get caching benefits
# I think if I force this to follow nixpkgs, I won't get caching benefits?
# helix.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko/master";
@ -26,19 +26,40 @@
api-lyte-dev.inputs.nixpkgs.follows = "nixpkgs";
ssbm.url = "github:lytedev/ssbm-nix";
# I think if I force this to follow nixpkgs, I won't get caching benefits
ssbm.inputs.nixpkgs.follows = "nixpkgs";
# ssbm.inputs.nixpkgs.follows = "nixpkgs";
# TODO: doesn't (can't?) support the forge mod loader yet
# nix-minecraft.url = "github:Infinidoge/nix-minecraft";
};
nixConfig = {
extra-experimental-features = ["nix-command" "flakes"];
extra-substituters = [
"https://cache.nixos.org/"
"https://helix.cachix.org"
# "https://ssbm-nix.cachix.org"
"https://nix-community.cachix.org"
"https://nix.h.lyte.dev"
];
extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
# "ssbm-nix.cachix.org-1:YN104LKAWaKQIecOphkftXgXlYZVK/IRHM1UD7WAIew="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
];
};
outputs = {
self,
nixpkgs,
home-manager,
sops-nix,
disko,
...
} @ inputs: let
}: let
inherit (self) outputs;
systems = [
@ -50,7 +71,7 @@
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
colors = (import ./lib/colors.nix inputs).schemes.catppuccin-mocha-sapphire;
colors = (import ./lib/colors.nix {inherit (nixpkgs) lib;}).schemes.catppuccin-mocha-sapphire;
# colors = (import ./lib/colors.nix inputs).color-schemes.donokai;
font = {
@ -67,7 +88,7 @@
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
overlays = import ./overlays;
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
@ -77,6 +98,16 @@
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
# TODO: nix-on-droid for phone terminal usage?
# TODO: nix-darwin for work?
# TODO: nixos ISO?
# Disk partition schemes and functions
diskoConfigurations = import ./disko;
# Flake templates for easily setting up Nix in a project using common patterns I like
templates = import ./templates/all.nix;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = builtins.mapAttrs (name: {
@ -86,11 +117,11 @@
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs outputs system;
};
modules =
[
sops-nix.nixosModules.sops
disko.nixosModules.disko
home-manager.nixosModules.home-manager
self.nixosModules.common
]
++ modules;
@ -105,10 +136,6 @@
in
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
};
modules = with outputs.homeManagerModules; [
common
{
@ -124,10 +151,6 @@
in
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
};
modules = with outputs.homeManagerModules; [
common
{
@ -139,35 +162,5 @@
];
};
};
# Disk partition schemes and functions
diskoConfigurations = import ./disko;
# Flake templates for easily setting up Nix in a project using common patterns I like
templates = import ./templates/all.nix;
# TODO: nix-on-droid for phone terminal usage?
# TODO: nix-darwin for work?
# TODO: nixos ISO?
};
nixConfig = {
extra-experimental-features = ["nix-command" "flakes"];
extra-substituters = [
"https://cache.nixos.org/"
"https://helix.cachix.org"
"https://ssbm-nix.cachix.org"
"https://nix-community.cachix.org"
"https://nix.h.lyte.dev"
];
extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"ssbm-nix.cachix.org-1:YN104LKAWaKQIecOphkftXgXlYZVK/IRHM1UD7WAIew="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
];
};
}

View file

@ -1,4 +1,4 @@
{nixpkgs, ...}: {
{lib, ...}: {
schemes = let
mkColorScheme = scheme @ {
scheme-name,
@ -51,7 +51,7 @@
// scheme;
in
{
withHashPrefix = nixpkgs.lib.mapAttrs (_: value: "#${value}") base;
withHashPrefix = lib.mapAttrs (_: value: "#${value}") base;
}
// base;
in {

View file

@ -1,27 +1,18 @@
{
config,
lib,
inputs,
outputs,
pkgs,
modulesPath,
...
}: let
inherit (pkgs) system;
inherit (pkgs) system lib;
in {
networking.hostName = lib.mkDefault "nixoslyte";
imports =
[
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
inputs.sops-nix.nixosModules.sops
inputs.disko.nixosModules.disko
inputs.home-manager.nixosModules.home-manager
]
++ (with outputs.nixosModules; [
avahi
daniel
]);
./avahi.nix
./daniel.nix
];
hardware.enableRedistributableFirmware = true;
@ -158,24 +149,24 @@ in {
useXkbConfig = true;
earlySetup = true;
colors = with outputs.colors; [
bg
red
green
orange
blue
purple
yellow
fg3
fgdim
red
green
orange
blue
purple
yellow
fg
];
# colors = with colors; [
# bg
# red
# green
# orange
# blue
# purple
# yellow
# fg3
# fgdim
# red
# green
# orange
# blue
# purple
# yellow
# fg
# ];
};
networking = {
@ -240,9 +231,9 @@ in {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# outputs.overlays.additions
# outputs.overlays.modifications
# outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
@ -269,28 +260,42 @@ in {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
settings = {
trusted-users = ["root" "daniel"];
experimental-features = lib.mkDefault ["nix-command" "flakes"];
substituters = [
"https://cache.nixos.org/"
"https://helix.cachix.org"
"https://nix-community.cachix.org"
"https://nix.h.lyte.dev"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
];
auto-optimise-store = true;
# optimise.automatic = true;
# optimise.dates = ["03:45"];
# gc = {
# automatic = true;
# dates = "weekly";
# options = "--delete-older-than 30d";
# };
auto-optimise-store = false;
};
# registry = {
# self.flake = inputs.self;
registry = {
# lytedev_nix = inputs.self;
# self.lytedev_nix = inputs.self;
# nixpkgs = {
# from = {
@ -299,7 +304,7 @@ in {
# };
# flake = inputs.nixpkgs;
# };
# };
};
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -1,17 +1,13 @@
{
config,
outputs,
...
}: {
{...}: {
# a minimal, familiar setup that I can bootstrap atop
imports = with outputs.nixosModules; [
imports = [
# may need to be tweaked based on the machine's paritioning scheme
outputs.diskoConfigurations.standard
desktop-usage
wifi
# outputs.diskoConfigurations.standard
# desktop-usage
# wifi
];
networking.hostName = config.home-manager.users.daniel.home.username;
networking.hostName = "lytedev_nixos_base";
# TODO: may not work for non-UEFI?
boot.loader.systemd-boot.enable = true;

View file

@ -8,7 +8,7 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x01 0x00
sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
*/
{
# inputs,
inputs,
# outputs,
# config,
pkgs,
@ -22,7 +22,7 @@ in {
../modules/nixos/fonts.nix
]
++ [
# inputs.api-lyte-dev.nixosModules.${system}.api-lyte-dev
inputs.api-lyte-dev.nixosModules.${system}.api-lyte-dev
# inputs.nix-minecraft.nixosModules.minecraft-servers
];

View file

@ -7,7 +7,7 @@ with builtins; (listToAttrs (map (name: {
}) [
"base"
"htpc"
"beefcake"
# "beefcake"
"dragon"
"foxtrot"
"musicbox"

View file

@ -32,6 +32,7 @@ in {
discord
slack
godot_4
fractal
variety # wallpaper switcher that I use with GNOME
radeontop
sops

View file

@ -1,4 +1,4 @@
{inputs, ...}: {
{
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs {pkgs = final;};
@ -7,13 +7,4 @@
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable'
unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs {
system = final.system;
config.allowUnfree = true;
};
};
}