Maybe working?

This commit is contained in:
Daniel Flanagan 2023-10-03 13:18:12 -05:00
parent 30b5da453d
commit a3304265d2
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
10 changed files with 114 additions and 73 deletions

View file

@ -120,6 +120,21 @@
"type": "github"
}
},
"hardware": {
"locked": {
"lastModified": 1696161939,
"narHash": "sha256-HI1DxS//s46/qv9dcW06TzXaBjxL2DVTQP8R1QsnHzM=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "0ab3ee718e964fb42dc57ace6170f19cb0b66532",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"helix": {
"inputs": {
"crane": "crane",
@ -279,6 +294,7 @@
"inputs": {
"api-lyte-dev": "api-lyte-dev",
"disko": "disko",
"hardware": "hardware",
"helix": "helix",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_4",

View file

@ -15,7 +15,8 @@
# TODO: do I really need this in the root of my flake if _only_ beefcake uses it?
api-lyte-dev.url = "git+ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git";
# TODO: hardware.url = "github:nixos/nixos-hardware"; # might be useful for laptops
hardware.url = "github:nixos/nixos-hardware";
# TODO: hyprland.url = "github:hyprwm/Hyprland";
# TODO: nix-colors.url = "github:misterio77/nix-colors";
};
@ -23,6 +24,7 @@
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
...
} @ inputs: let
@ -59,16 +61,28 @@
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
dragon = nixpkgs.lib.nixosSystem {
nixosConfigurations = let
mkNixosSystem = system: modules:
nixpkgs.lib.nixosSystem {
system = system;
specialArgs = {
inherit inputs outputs;
inherit inputs outputs system;
flake = self;
};
modules = [
./nixos/dragon
];
modules = [self.nixosModules.common] ++ modules;
};
# mkNixosUnstableSystem = system: modules:
# nixpkgs-unstable.lib.nixosSystem {
# system = system;
# specialArgs = {
# inherit inputs outputs system;
# flake = self;
# };
# modules = [ self.nixosModules.common ] ++ modules;
# };
in {
dragon = mkNixosSystem "x86_64-linux" [./nixos/dragon];
thinker = mkNixosSystem "x86_64-linux" [./nixos/thinker];
};
# Standalone home-manager configuration entrypoint

View file

@ -6,6 +6,7 @@
...
}: let
pkgs = inputs.nixpkgs.legacyPackages.${system};
unstable-pkgs = inputs.nixpkgs-unstable.legacyPackages.${system};
in {
services.journald.extraConfig = "SystemMaxUse=1G";
@ -17,7 +18,8 @@ in {
MANPAGER = "less";
};
systemPackages = with pkgs; [
systemPackages = with pkgs;
[
age
bat
bc
@ -28,7 +30,6 @@ in {
curl
dog
dua
eza
fd
file
gnumake
@ -61,7 +62,10 @@ in {
xh
zellij
zstd
];
]
++ (with unstable-pkgs; [
eza
]);
};
users.users = {

View file

@ -1,6 +1,7 @@
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
common = import ./common.nix;
amd = import ./amd.nix;
desktop-usage = import ./desktop-usage.nix;
intel = import ./intel.nix;

View file

@ -6,7 +6,8 @@
./user-installed-applications.nix
];
fonts.packages = with pkgs; [
# fonts.packages if unstable?
fonts.fonts = with pkgs; [
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
(iosevka.override {
set = "lyteterm";

View file

@ -8,7 +8,6 @@
...
}: {
networking.hostName = "dragon";
nixpkgs.hostPlatform = "x86_64-linux";
imports =
[

View file

@ -1,32 +1,38 @@
{
modulesPath,
flake,
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
../modules/intel.nix
../modules/desktop-usage.nix
../modules/podman.nix
../modules/wifi.nix
networking.hostName = "thinker";
(modulesPath + "/installer/scan/not-detected.nix")
imports =
[
inputs.disko.nixosModules.disko
flake.diskoConfigurations.thinker
]
++ (with outputs.nixosModules; [
# If you want to use modules your own flake exports (from modules/nixos):
desktop-usage
podman
postgres
wifi
])
++ [
inputs.hardware.nixosModules.lenovo-thinkpad-t480
# ./relative-module.nix
];
# TODO: https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/t480/default.nix
# TODO: hibernation? I've been using [deep] in /sys/power/mem_sleep alright
# with this machine so it may not be necessary?
# need to measure percentage lost per day, but I think it's around 10%/day
# it looks like I may have had hibernation working -- see ../old/third.nix
# hardware
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
networking.hostName = "thinker";
services.pcscd.enable = true; # why do I need this? SD card slot?
hardware.bluetooth.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
services.printing.enable = true; # I own a printer in the year of our Lord 2023