Reducing common

This commit is contained in:
Daniel Flanagan 2024-01-02 18:54:46 -06:00
parent f7baafbc1e
commit 834e4c77ec
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
7 changed files with 110 additions and 39 deletions

View file

@ -112,7 +112,11 @@
} }
]; ];
}; };
base = mkNixosSystem "x86_64-linux" [./nixos/base] [outputs.homeManagerModules.base];
in { in {
base = base;
nixos = base; # alias
dragon = mkNixosSystem "x86_64-linux" [./nixos/dragon] (with outputs.homeManagerModules; [ dragon = mkNixosSystem "x86_64-linux" [./nixos/dragon] (with outputs.homeManagerModules; [
dragon dragon
]); ]);

View file

@ -0,0 +1,5 @@
{outputs, ...}: {
imports = with outputs.homeManagerModules; [
sway
];
}

View file

@ -62,14 +62,15 @@
]; ];
}; };
programs.password-store = { # TODO: not common?
enable = true; # programs.password-store = {
package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); # enable = true;
}; # package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
# };
programs.gitui = { # programs.gitui = {
enable = true; # enable = true;
}; # };
programs.direnv = { programs.direnv = {
enable = true; enable = true;
@ -97,6 +98,7 @@
# fileWidgetOptions = ["--preview 'head {}'"]; # fileWidgetOptions = ["--preview 'head {}'"];
}; };
# TODO: regular cron or something?
programs.nix-index = { programs.nix-index = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;

View file

@ -32,6 +32,7 @@
htop = import ./htop.nix; htop = import ./htop.nix;
senpai = import ./senpai.nix; senpai = import ./senpai.nix;
base = import ./base.nix;
dragon = import ./dragon.nix; dragon = import ./dragon.nix;
thinker = import ./thinker.nix; thinker = import ./thinker.nix;
foxtrot = import ./foxtrot.nix; foxtrot = import ./foxtrot.nix;

View file

@ -31,7 +31,7 @@
output = { output = {
"GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = { "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = {
mode = "3840x2160@120Hz"; mode = "3840x2160@120Hz";
position = "0,0"; position = "${toString (builtins.ceil (2160 / 1.5))},0";
}; };
"Dell Inc. DELL U2720Q D3TM623" = { "Dell Inc. DELL U2720Q D3TM623" = {
@ -39,7 +39,7 @@
mode = "3840x2160@60Hz"; mode = "3840x2160@60Hz";
transform = "90"; transform = "90";
scale = "1.5"; scale = "1.5";
position = "3840,0"; position = "0,0";
}; };
}; };

View file

@ -8,6 +8,8 @@
pkgs, pkgs,
... ...
}: { }: {
networking.hostName = lib.mkDefault "nixoslyte";
imports = [ imports = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
]; ];
@ -26,51 +28,51 @@
systemPackages = with pkgs; systemPackages = with pkgs;
[ [
age # age
bat # bat
bc # bc
bind # bind
bottom # bottom
btrfs-progs # btrfs-progs
cue # cue
curl curl
dogdns # dogdns
dua dua
eza eza
fd fd
file file
fzf fzf
gnumake gnumake
gron # gron
hexyl # hexyl
iputils iputils
jq # jq
killall killall
less less
mosh mosh
nmap # nmap
nettools nettools
openssl openssl
pciutils # pciutils
pv # pv
rclone # rclone
restic # restic
ripgrep ripgrep
rsync rsync
rtx # rtx
sd sd
sops # sops
smartmontools smartmontools
sqlite # sqlite
skim # skim
sysstat # sysstat
unzip unzip
usbutils # usbutils
watchexec # watchexec
wget wget
xh # xh
zellij zellij
zstd # zstd
] ]
++ (with inputs.home-manager.packages.${system}; [ ++ (with inputs.home-manager.packages.${system}; [
home-manager home-manager
@ -168,6 +170,7 @@
allowedUDPPorts = lib.mkDefault []; allowedUDPPorts = lib.mkDefault [];
}; };
# TODO: podman equivalent?
extraHosts = '' extraHosts = ''
::1 host.docker.internal ::1 host.docker.internal
127.0.0.1 host.docker.internal 127.0.0.1 host.docker.internal
@ -245,9 +248,10 @@
defaultUserShell = pkgs.fish; defaultUserShell = pkgs.fish;
}; };
services.udev.extraRules = '' # TODO: should not be in common?
# https://betaflight.com/docs/wiki/archive/Installing-Betaflight#step-1 # services.udev.extraRules = ''
# ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp" # # https://betaflight.com/docs/wiki/archive/Installing-Betaflight#step-1
# ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"' # # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"
''; # # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"'
# '';
} }

55
nixos/base/default.nix Normal file
View file

@ -0,0 +1,55 @@
{
flake,
inputs,
outputs,
lib,
config,
modulesPath,
...
}: {
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard
]
++ (with outputs.nixosModules; [
desktop-usage
wifi
]);
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
config = {
allowUnfree = true;
};
};
nix = {
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
};
};
# not necessarily "base", but all my machines are UEFI so...
boot.loader.systemd-boot.enable = true;
networking = {
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [22];
allowedUDPPorts = [];
};
};
system.stateVersion = "23.11";
}