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" "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": { "root": {
"inputs": { "inputs": {
"api-lyte-dev": "api-lyte-dev", "api-lyte-dev": "api-lyte-dev",
@ -308,9 +324,7 @@
}, },
"ssbm": { "ssbm": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": "nixpkgs_3",
"nixpkgs"
],
"slippi-desktop": "slippi-desktop" "slippi-desktop": "slippi-desktop"
}, },
"locked": { "locked": {

View file

@ -6,7 +6,7 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
helix.url = "github:helix-editor/helix/master"; 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"; # helix.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko/master"; disko.url = "github:nix-community/disko/master";
@ -26,19 +26,40 @@
api-lyte-dev.inputs.nixpkgs.follows = "nixpkgs"; api-lyte-dev.inputs.nixpkgs.follows = "nixpkgs";
ssbm.url = "github:lytedev/ssbm-nix"; 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 # TODO: doesn't (can't?) support the forge mod loader yet
# nix-minecraft.url = "github:Infinidoge/nix-minecraft"; # 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 = { outputs = {
self, self,
nixpkgs, nixpkgs,
home-manager, home-manager,
sops-nix,
disko,
... ...
} @ inputs: let }: let
inherit (self) outputs; inherit (self) outputs;
systems = [ systems = [
@ -50,7 +71,7 @@
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
in { 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; # colors = (import ./lib/colors.nix inputs).color-schemes.donokai;
font = { font = {
@ -67,7 +88,7 @@
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays # Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;}; overlays = import ./overlays;
# Reusable nixos modules you might want to export # Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs # These are usually stuff you would upstream into nixpkgs
@ -77,6 +98,16 @@
# These are usually stuff you would upstream into home-manager # These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/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 # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = builtins.mapAttrs (name: { nixosConfigurations = builtins.mapAttrs (name: {
@ -86,11 +117,11 @@
}: }:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = {
inherit inputs outputs system;
};
modules = modules =
[ [
sops-nix.nixosModules.sops
disko.nixosModules.disko
home-manager.nixosModules.home-manager
self.nixosModules.common self.nixosModules.common
] ]
++ modules; ++ modules;
@ -105,10 +136,6 @@
in in
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
};
modules = with outputs.homeManagerModules; [ modules = with outputs.homeManagerModules; [
common common
{ {
@ -124,10 +151,6 @@
in in
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
};
modules = with outputs.homeManagerModules; [ modules = with outputs.homeManagerModules; [
common 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 schemes = let
mkColorScheme = scheme @ { mkColorScheme = scheme @ {
scheme-name, scheme-name,
@ -51,7 +51,7 @@
// scheme; // scheme;
in in
{ {
withHashPrefix = nixpkgs.lib.mapAttrs (_: value: "#${value}") base; withHashPrefix = lib.mapAttrs (_: value: "#${value}") base;
} }
// base; // base;
in { in {

View file

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

View file

@ -1,17 +1,13 @@
{ {...}: {
config,
outputs,
...
}: {
# a minimal, familiar setup that I can bootstrap atop # 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 # may need to be tweaked based on the machine's paritioning scheme
outputs.diskoConfigurations.standard # outputs.diskoConfigurations.standard
desktop-usage # desktop-usage
wifi # wifi
]; ];
networking.hostName = config.home-manager.users.daniel.home.username; networking.hostName = "lytedev_nixos_base";
# TODO: may not work for non-UEFI? # TODO: may not work for non-UEFI?
boot.loader.systemd-boot.enable = true; 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 sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
*/ */
{ {
# inputs, inputs,
# outputs, # outputs,
# config, # config,
pkgs, pkgs,
@ -22,7 +22,7 @@ in {
../modules/nixos/fonts.nix ../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 # inputs.nix-minecraft.nixosModules.minecraft-servers
]; ];

View file

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

View file

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

View file

@ -1,4 +1,4 @@
{inputs, ...}: { {
# This one brings our custom packages from the 'pkgs' directory # This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs {pkgs = final;}; additions = final: _prev: import ../pkgs {pkgs = final;};
@ -7,13 +7,4 @@
# https://nixos.wiki/wiki/Overlays # https://nixos.wiki/wiki/Overlays
modifications = final: prev: { 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;
};
};
} }