WIP move to template

This commit is contained in:
Daniel Flanagan 2023-10-03 11:52:44 -05:00
parent 3d62eaafd7
commit 4a2fd7718f
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
108 changed files with 578 additions and 432 deletions

View file

@ -120,21 +120,6 @@
"type": "github"
}
},
"flake-utils_3": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"helix": {
"inputs": {
"crane": "crane",
@ -164,15 +149,16 @@
]
},
"locked": {
"lastModified": 1696145345,
"narHash": "sha256-3dM7I/d4751SLPJah0to1WBlWiyzIiuCEUwJqwBdmr4=",
"lastModified": 1695108154,
"narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "6f9b5b83ad1f470b3d11b8a9fe1d5ef68c7d0e30",
"rev": "07682fff75d41f18327a871088d20af2710d4744",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.05",
"repo": "home-manager",
"type": "github"
}
@ -209,6 +195,22 @@
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1696019113,
"narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1696125185,
@ -243,15 +245,16 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1696275311,
"narHash": "sha256-Z8aJvoUyMv/+0G7iqYIqecxRDFbz05RK2e3/irbWq9M=",
"owner": "NixOS",
"lastModified": 1696039360,
"narHash": "sha256-g7nIUV4uq1TOVeVIDEZLb005suTWCUjSY0zYOlSBsyE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "828ba8482b64704adad28786355ed8a45d59eb0a",
"rev": "32dcb45f66c0487e92db8303a798ebc548cadedc",
"type": "github"
},
"original": {
"owner": "NixOS",
"owner": "nixos",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
@ -279,8 +282,8 @@
"helix": "helix",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_4",
"sops-nix": "sops-nix",
"utils": "utils"
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix"
}
},
"rust-overlay": {
@ -356,24 +359,6 @@
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"flake-utils": "flake-utils_3"
},
"locked": {
"lastModified": 1696272629,
"narHash": "sha256-KprLE/cqg5PFNT1PKQRjE/bJpr4AlgedoUPO/4jee+8=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "2893fcad90dcc2ac2265c227b5444a7cd7ef21f0",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"type": "github"
}
}
},
"root": "root",

View file

@ -1,26 +1,92 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
# nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-channels/nixos-unstable";
api-lyte-dev.url = "git+ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
# inputs.utils.follows = "utils";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-23.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b";
disko.url = "github:nix-community/disko/master";
sops-nix.url = "github:Mic92/sops-nix";
helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b";
# 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
# TODO: hyprland.url = "github:hyprwm/Hyprland";
# TODO: nix-colors.url = "github:misterio77/nix-colors";
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
systems = [
"aarch64-linux"
# "i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
dragon = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./nixos/dragon
];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"daniel@lyte.dev" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [./home-manager/home.nix];
};
"daniel.flanagan@hq.bill.com" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
extraSpecialArgs = {inherit inputs outputs;};
modules = [./home-manager/home.nix];
};
};
outputs = inputs @ { self, ... }: {
diskoConfigurations = import ./disko.nix;
homeConfigurations = import ./home.nix inputs;
nixosConfigurations = import ./nixos.nix inputs;
# TODO: darwin for work?
# TODO: nixos ISO?
# Disk partition schemes and functions
diskoConfigurations = import ./disko.nix;
};
}

View file

@ -1,25 +0,0 @@
inputs:
let
mkHome = system: modules:
let
overlay = final: prev: {
helix = prev.helix // inputs.helix.packages.${system}.helix;
};
pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; };
in
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ] ++ modules;
};
in
{
daniel = mkHome "x86_64-linux" [
./home/user.nix
./home/linux.nix
];
daniel-work = mkHome "aarch64-darwin" [
./home/user.nix
./home/work.nix
];
}

25
home/default.nix Normal file
View file

@ -0,0 +1,25 @@
inputs: let
mkHome = system: modules: let
overlay = final: prev: {
helix = prev.helix // inputs.helix.packages.${system}.helix;
};
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [overlay];
};
in
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [] ++ modules;
};
in {
daniel = mkHome "x86_64-linux" [
./home/user.nix
./home/linux.nix
];
daniel-work = mkHome "aarch64-darwin" [
./home/user.nix
./home/work.nix
];
}

View file

@ -1,9 +1,11 @@
{ pkgs, lib, ... }:
let
{
pkgs,
lib,
...
}: let
email = "daniel@lyte.dev";
name = "Daniel Flanagan";
in
{
in {
# TODO: email access?
# accounts.email.accounts = {
# google = {
@ -36,7 +38,10 @@ in
pkgs.nixpkgs-fmt
# TODO: os-specific scripts? macOS versus Linux (arch or nixos? do I need to distinguish at that point?)
(pkgs.buildEnv { name = "my-scripts-common"; paths = [ ../scripts/common ]; })
(pkgs.buildEnv {
name = "my-scripts-common";
paths = [../scripts/common];
})
];
file = {
@ -79,7 +84,7 @@ in
programs = {
password-store = {
enable = true;
package = (pkgs.pass.withExtensions (exts: [ exts.pass-otp ]));
package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
};
git = {
@ -172,7 +177,11 @@ in
deno = {
command = "deno";
args = ["lsp"];
config = { enable = true; lint = true; unstable = true; };
config = {
enable = true;
lint = true;
unstable = true;
};
};
};
@ -256,7 +265,10 @@ in
roots = ["deno.jsonc" "deno.json"];
file-types = ["jsonc"];
language-servers = ["deno"];
indent = { tab-width = 2; unit = " "; };
indent = {
tab-width = 2;
unit = " ";
};
auto-format = true;
}
@ -335,12 +347,15 @@ in
center = ["file-name"];
right = ["version-control" "total-line-numbers" "file-encoding"];
};
};
keys = {
insert = {
j = { k = "normal_mode"; j = "normal_mode"; K = "normal_mode"; J = "normal_mode"; };
j = {
k = "normal_mode";
j = "normal_mode";
K = "normal_mode";
J = "normal_mode";
};
};
normal = {
@ -362,9 +377,11 @@ in
};
};
select = {
space = { q = ":reflow 80"; Q = ":reflow 120"; };
space = {
q = ":reflow 80";
Q = ":reflow 120";
};
"L" = "repeat_last_motion";
};
};
@ -406,7 +423,8 @@ in
repo = "bat";
rev = "477622171ec0529505b0ca3cada68fc9433648c6";
sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
} + "/Catppuccin-mocha.tmTheme");
}
+ "/Catppuccin-mocha.tmTheme");
};
};
@ -689,7 +707,11 @@ in
};
verbs = [
{ invocation = "edit"; shortcut = "e"; execution = "$EDITOR {file}"; }
{
invocation = "edit";
shortcut = "e";
execution = "$EDITOR {file}";
}
];
};
};

View file

@ -1,4 +1,8 @@
{ config, pkgs, ... }: {
{
config,
pkgs,
...
}: {
home.pointerCursor = {
name = "Bibata-Modern-Classic";
package = pkgs.bibata-cursors;
@ -16,16 +20,39 @@
enable = true;
events = [
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }
{
event = "before-sleep";
command = "${pkgs.swaylock}/bin/swaylock";
}
];
timeouts = [
{ timeout = 330; command = "notify-send \"Idling in 300 seconds\""; resumeCommand = "notify-send \"Idling cancelled.\""; }
{ timeout = 540; command = "notify-send \"Idling in 90 seconds\""; }
{ timeout = 570; command = "notify-send \"Idling in 60 seconds\""; }
{ timeout = 600; command = "notify-send \"Idling in 30 seconds...\""; }
{ timeout = 630; command = "swaylock -f"; }
{ timeout = 660; command = "swaymsg \"output * dpms off\""; resumeCommand = "swaymsg \"output * dpms on\" & maybe-good-morning &"; }
{
timeout = 330;
command = "notify-send \"Idling in 300 seconds\"";
resumeCommand = "notify-send \"Idling cancelled.\"";
}
{
timeout = 540;
command = "notify-send \"Idling in 90 seconds\"";
}
{
timeout = 570;
command = "notify-send \"Idling in 60 seconds\"";
}
{
timeout = 600;
command = "notify-send \"Idling in 30 seconds...\"";
}
{
timeout = 630;
command = "swaylock -f";
}
{
timeout = 660;
command = "swaymsg \"output * dpms off\"";
resumeCommand = "swaymsg \"output * dpms on\" & maybe-good-morning &";
}
];
};
};
@ -88,8 +115,14 @@
};
startup = [
{ command = "systemctl --user restart waybar"; always = true; }
{ command = "systemctl --user restart swayidle"; always = true; }
{
command = "systemctl --user restart waybar";
always = true;
}
{
command = "systemctl --user restart swayidle";
always = true;
}
{command = "firefox";}
{command = "kitty --single-instance";}
];
@ -130,9 +163,10 @@
middle_emulation = "enabled";
# pointer_accel
};
};
keybindings = let mod = config.wayland.windowManager.sway.config.modifier; in {
keybindings = let
mod = config.wayland.windowManager.sway.config.modifier;
in {
# bindsym $mod+shift+space exec wofi --show drun
"${mod}+control+space" = "exec makoctl dismiss";
"${mod}+shift+space" = "exec makoctl invoke";
@ -257,7 +291,10 @@
};
home.packages = [
(pkgs.buildEnv { name = "my-linux-scripts"; paths = [ ../scripts/linux ]; })
(pkgs.buildEnv {
name = "my-linux-scripts";
paths = [../scripts/linux];
})
];
programs = {
@ -638,7 +675,6 @@
systemd = {
enable = true;
};
};
firefox = {
@ -647,7 +683,7 @@
enable = true;
# TODO: uses nixpkgs.pass so pass otp doesn't work
package = (pkgs.firefox.override { extraNativeMessagingHosts = [ pkgs.passff-host ]; });
package = pkgs.firefox.override {extraNativeMessagingHosts = [pkgs.passff-host];};
# extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# ublock-origin
@ -726,5 +762,3 @@
};
};
}

View file

@ -1,8 +1,6 @@
{ lib, ... }:
let
{lib, ...}: let
username = "daniel.flanagan@divvypay.com";
in
{
in {
home.username = username;
home.homeDirectory = "/Users/${username}";
}

View file

@ -0,0 +1,6 @@
# Add your reusable home-manager 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.
{
# List your module files here
# my-module = import ./my-module.nix;
}

View file

@ -1,3 +1,7 @@
{ config, lib, ... }: {
{
config,
lib,
...
}: {
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

14
modules/nixos/default.nix Normal file
View file

@ -0,0 +1,14 @@
# 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.
{
amd = import ./amd.nix;
default = import ./default.nix;
desktop-usage = import ./desktop-usage.nix;
intel = import ./intel.nix;
pipewire = import ./pipewire.nix;
podman = import ./podman.nix;
postgres = import ./postgres.nix;
sway = import ./sway.nix;
user-installed-applications = import ./user-installed-applications.nix;
wifi = import ./wifi.nix;
}

View file

@ -147,4 +147,3 @@
magicOrExtension = ''\x7fELF....AI\x02'';
};
}

View file

@ -1,5 +1,9 @@
{ lib, config, pkgs, ... }: {
{
lib,
config,
pkgs,
...
}: {
nixpkgs.config = {
packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
let
{pkgs, ...}: let
# this is unused because it's referenced by my sway config
dbus-sway-environment = pkgs.writeTextFile {
name = "dbus-sway-environment";
@ -18,19 +17,16 @@ let
name = "configure-gtk";
destination = "/bin/configure-gtk";
executable = true;
text =
let
text = let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in
''
in ''
export XDG_DATA_DIRS="${datadir}:$XDG_DATA_DIRS
gnome_schema = org.gnome.desktop.interface
gsettings set $gnome_schema gtk-theme 'Catppuccin-Mocha'
'';
};
in
{
in {
imports = [./pipewire.nix];
# services.xserver.libinput.enable = true;

View file

@ -1,8 +1,12 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running 'nixos-help').
{ modulesPath, config, pkgs, ... }: {
{
modulesPath,
config,
pkgs,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
../modules/intel.nix
@ -11,8 +15,7 @@
boot.initrd.availableKernelModules = ["ehci_pci" "megaraid_sas" "usbhid" "uas" "sd_mod"];
boot.kernelModules = ["kvm-intel"];
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-uuid/0747dcba-f590-42e6-89c8-6cb2f9114d64";
fsType = "ext4";
options = [
@ -20,14 +23,12 @@
];
};
fileSystems."/boot" =
{
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/7E3C-9018";
fsType = "vfat";
};
fileSystems."/storage" =
{
fileSystems."/storage" = {
device = "/dev/disk/by-uuid/ea8258d7-54d1-430e-93b3-e15d33231063";
fsType = "btrfs";
options = [
@ -182,9 +183,11 @@
users.users.restic = {
# used for other machines to backup to
isNormalUser = true;
openssh.authorizedKeys.keys = [
openssh.authorizedKeys.keys =
[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJbPqzKB09U+i4Kqu136yOjflLZ/J7pYsNulTAd4x903 root@chromebox.h.lyte.dev"
] ++ config.users.users.daniel.openssh.authorizedKeys.keys;
]
++ config.users.users.daniel.openssh.authorizedKeys.keys;
};
users.users.guest = {
@ -452,8 +455,14 @@
services.openssh = {
listenAddresses = [
{ addr = "0.0.0.0"; port = 64022; }
{ addr = "0.0.0.0"; port = 22; }
{
addr = "0.0.0.0";
port = 64022;
}
{
addr = "0.0.0.0";
port = 22;
}
];
};

View file

@ -1,8 +1,12 @@
{ config, lib, inputs, system, ... }:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
config,
lib,
inputs,
system,
...
}: let
pkgs = inputs.nixpkgs.legacyPackages.${system};
in {
services.journald.extraConfig = "SystemMaxUse=1G";
environment = {

View file

@ -1,5 +1,4 @@
inputs @ { self, ... }:
let
inputs @ {self, ...}: let
daniel = system: {
home-manager.users.daniel = {
imports = [./home/user.nix ./home/linux.nix];
@ -16,13 +15,15 @@ let
];
nixosSystem = system: modules: (inputs.nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs system;};
modules = [
modules =
[
inputs.sops-nix.nixosModules.sops
./nixos/common.nix
] ++ modules ++ hms system;
]
++ modules
++ hms system;
});
in
{
in {
# TODO: disko-fy rascal and beefcake?
beefcake = nixosSystem "x86_64-linux" [
@ -36,17 +37,20 @@ in
{
scheme = "unencrypted";
disks = ["/dev/sda"];
} ++ [ ./nixos/musicbox.nix ]);
}
++ [./nixos/musicbox.nix]);
thinker = nixosSystem "x86_64-linux" (disko
{
scheme = "thinker";
disks = ["/dev/nvme0n1"];
} ++ [ ./nixos/thinker.nix ]);
}
++ [./nixos/thinker.nix]);
dragon = nixosSystem "x86_64-linux" (disko
{
scheme = "standard";
disks = ["/dev/nvme0n1"];
} ++ [ ./nixos/dragon.nix ]);
}
++ [./nixos/dragon.nix]);
}

View file

@ -1,43 +0,0 @@
{ modulesPath, lib, pkgs, ... }: {
imports =
[
../modules/amd.nix
../modules/desktop-usage.nix
../modules/podman.nix
../modules/wifi.nix
(modulesPath + "/installer/scan/not-detected.nix")
];
# TODO: fonts? right now, I'm just installing to ~/.local/share/fonts
# hardware
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
networking.hostName = "dragon";
hardware.bluetooth.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
services.printing.enable = true;
environment = {
systemPackages = with pkgs; [
radeontop
];
};
networking = {
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [ 22 ];
allowedUDPPorts = [ ];
};
};
system.stateVersion = "23.11";
}

Some files were not shown because too many files have changed in this diff Show more