rewrite to be more module based

trunk
Nathan McCarty 2022-06-23 02:57:41 -04:00
parent f62e627c5e
commit 43c78acc15
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
84 changed files with 1642 additions and 3325 deletions

View File

@ -1,96 +0,0 @@
# Communications software
{ config, pkgs, unstable, ... }:
{
# Pull in personal overlay
# nixpkgs.overlays = [ (import ../../overlays/personal/overlay.nix) ];
environment.systemPackages = with pkgs;
let
enableWayland = drv: bin: drv.overrideAttrs (
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ];
postFixup = (old.postFixup or "") + ''
wrapProgram $out/bin/${bin} \
--add-flags "--enable-features=UseOzonePlatform" \
--add-flags "--ozone-platform=wayland"
'';
}
);
## Wayland workaround chromium desktop items
# Facebook messenger
fbChromeDesktopItem = pkgs.makeDesktopItem {
name = "messenger-chrome";
desktopName = "Messenger (chrome)";
exec = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland --app=\"https://messenger.com\"";
terminal = false;
};
# Teams
teamsItem = pkgs.makeDesktopItem {
name = "teams-wayland";
desktopName = "Teams (Wayland)";
exec = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland --app=\"https://teams.microsoft.com\"";
terminal = false;
};
# Discord
discordWayland = pkgs.callPackage ../packages/discord/default.nix rec {
pname = "discord-electron";
binaryName = "Discord";
desktopName = "Discord (Wayland)";
version = "0.0.18";
src = fetchurl {
url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
hash = "sha256-BBc4n6Q3xuBE13JS3gz/6EcwdOWW57NLp2saOlwOgMI=";
};
electron = pkgs.electron_13;
};
## Pass wayland options to existing applications
signalWaylandItem = pkgs.makeDesktopItem {
name = "signal-desktop-wayland";
desktopName = "Signal (Wayland)";
exec = "${unstable.signal-desktop}/bin/signal-desktop --enable-features=UseOzonePlatform -ozone-platform=wayland";
terminal = false;
icon = "signal-desktop";
type = "Application";
};
zulipWayland = pkgs.makeDesktopItem {
name = "zulip-wayland";
desktopName = "Zulip (Wayland)";
exec = "${unstable.zulip}/bin/zulip --enable-features=UseOzonePlatform --ozone-platform=wayland";
terminal = false;
icon = "zulip";
type = "Application";
};
in
[
# Discord
discordWayland
unstable.betterdiscordctl
# Desktop matrix client
(enableWayland element-desktop "element-desktop")
# Desktop signal client
(enableWayland signal-desktop "signal-desktop")
# Desktop telegram client
tdesktop
# Desktop mastodon client
tootle
# zulip
unstable.zulip
zulipWayland
# Zoom (for work, sadly)
unstable.zoom-us
# Teams (also for work)
unstable.teams
# chromium
chromium
# Wayland workaround packages
fbChromeDesktopItem
teamsItem
];
# Work around for discord jank ugh
nixpkgs.config.permittedInsecurePackages = [
"electron-13.6.9"
];
}

View File

@ -1,10 +0,0 @@
# Linux Specific Core development libraries
{ config, pkgs, unstable, ... }:
{
environment.systemPackages = with pkgs; [
gcc
binutils
clang
unstable.mold
];
}

View File

@ -1,31 +0,0 @@
# Core development libraries
{ config, pkgs, unstable, ... }:
{
environment.systemPackages = with pkgs; [
# Full version of git
unstable.gitFull
# Git addons
git-secret
unstable.git-lfs
delta
# General development requirements
python3Full
cmake
libtool
gnumake
nixpkgs-fmt
# jq for interacting with JSON
jq
jc
# Viewer for deeply nested JSON
fx
# Direnv for nix-shell niceness
direnv
# Sops for secrets
sops
# Just in case
neovim
# For python
nodePackages.pyright
];
}

View File

@ -1,10 +0,0 @@
{ config, unstable, pkgs, ... }:
{
environment.systemPackages = with unstable; [
nodejs
yarn
nodePackages.typescript
deno
];
}

View File

@ -1,12 +0,0 @@
{ config, lib, pkgs, java, unstable, ... }:
{
environment.systemPackages = with unstable; [
java.packages.${system}.semeru-stable
gradle
kotlin
kotlin-native
kotlin-language-server
ktlint
];
}

View File

@ -1,8 +0,0 @@
{ config, lib, pkgs, unstable, ... }:
{
environment.systemPackages = with unstable; [
rakudo
zef
];
}

View File

@ -1,27 +0,0 @@
# Utilities for developing in rust
{ config, pkgs, unstable, fenix, ... }:
{
environment.systemPackages = with pkgs; [
# Use rustup to get the compiler
rustup
# Install the latest rust analyzer
fenix.packages."${system}".rust-analyzer
# Sccache for faster builds
sccache
# Misc cargo utilites
cargo-binutils # Allow invoking the llvm tools included with the toolchain
cargo-edit # Command line Cargo.toml manipulation
cargo-asm # Dump the generated assembly
cargo-fuzz # front end for fuzz testing rust
cargo-license # Audit the licenses of dependencies
cargo-criterion # Benchmarking front end
cargo-audit # Check dependencies for known CVEs
cargo-bloat # Find out what's taking up space in the executable
cargo-udeps # Find unused dependencies
cargo-expand # Dump expanded macros
unstable.cargo-tarpaulin # Code coverage
cargo-play # Quickly execute code outside of a crate
# For building stuff that uses protocol buffers
protobuf
];
}

View File

@ -1,28 +0,0 @@
{ config, pkgs, doomEmacs, ... }:
{
# Install emacs
environment.systemPackages = with pkgs; [
# For markdown rendering
python39Packages.grip
# For graph generation
graphviz
];
# Utilize home-manager
home-manager.users.nathan = {
# Nixify doomEmacs
# TODO:Reenable, currently off because of ghub
imports = [ doomEmacs ];
programs.doom-emacs = {
enable = true;
doomPrivateDir = ../doom.d;
emacsPackage = pkgs.emacsPgtkNativeComp;
};
# Startup service
services.emacs = {
enable = pkgs.stdenv.isLinux;
client.enable = true;
defaultEditor = true;
};
};
}

View File

@ -1,16 +0,0 @@
# Image editing applications
{ config, pkgs, unstable, ... }:
{
environment.systemPackages = with pkgs; [
# RawTherapee for raw editing
unstable.rawtherapee
# Gimp for complex editing
unstable.gimp-with-plugins
# Krita for drawing
unstable.krita
# Pinta for basic image editing
unstable.pinta
# Command line tools for image conversion and handling
imagemagickBig
];
}

View File

@ -1,163 +0,0 @@
# Media players and other applications
{ config, pkgs, lib, unstable, ... }:
let
mopidyEnv = pkgs.buildEnv {
name = "mopidy-daemon-environment";
paths = with pkgs; [
mopidy-mpd
mopidy-iris
mopidy-scrobbler
mopidy-local
];
pathsToLink = [ "/${pkgs.mopidyPackages.python.sitePackages}" ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
makeWrapper ${pkgs.mopidy}/bin/mopidy $out/bin/mopidy \
--prefix PYTHONPATH : $out/${pkgs.mopidyPackages.python.sitePackages}
'';
};
mopidyConf = pkgs.writeText "mopidy.conf"
''
[core]
#cache_dir = $XDG_CACHE_DIR/mopidy
#config_dir = $XDG_CONFIG_DIR/mopidy
#data_dir = $XDG_DATA_DIR/mopidy
#max_tracklist_length = 10000
#restore_state = false
[logging]
#verbosity = 0
#format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
#color = true
#config_file =
[audio]
#mixer = software
#mixer_volume =
#output = autoaudiosink
#buffer_time =
[proxy]
#scheme =
#hostname =
#port =
#username =
#password =
[file]
enabled = true
media_dirs =
~/Music
# $XDG_MUSIC_DIR|Music
#excluded_file_extensions =
# .directory
# .html
# .jpeg
# .jpg
# .log
# .nfo
# .pdf
# .png
# .txt
# .zip
#show_dotfiles = false
#follow_symlinks = false
#metadata_timeout = 1000
[local]
media_dir = /home/nathan/Music
[http]
#enabled = true
#hostname = 127.0.0.1
#port = 6680
#zeroconf = Mopidy HTTP server on $hostname
#allowed_origins =
#csrf_protection = true
#default_app = mopidy
[m3u]
#enabled = true
#base_dir = $XDG_MUSIC_DIR
#default_encoding = latin-1
#default_extension = .m3u8
#playlists_dir =
[softwaremixer]
#enabled = true
[stream]
#enabled = true
#protocols =
# http
# https
# mms
# rtmp
# rtmps
# rtsp
#metadata_blacklist =
#timeout = 5000
[mpd]
enabled = true
'';
in
{
environment.systemPackages =
let
## Wrapper around iris
irisDesktopItem = pkgs.makeDesktopItem {
name = "iris";
desktopName = "Iris";
exec = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform -ozone-platform=wayland --app=\"http://localhost:6680/iris/\"";
terminal = false;
};
in
with pkgs; [
# Spotify
spotify
# Latest version of vlc
unstable.vlc
# Plex client
plex-media-player
# OBS studio for screen recording
unstable.obs-studio
# Soulseek client
nicotine-plus
# Mopidy + extensions
mopidyEnv
# Iris desktop client
irisDesktopItem
# Picard for sorting
unstable.picard
];
# Start mopidy as a user service, for sanity
systemd.user.services.mopidy = {
description = "Mopidy music server";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${mopidyEnv}/bin/mopidy --config ${lib.concatStringsSep ":" [mopidyConf config.sops.secrets.lastfm-conf.path]}";
};
wants = [ "rclone-music.service" ];
enable = true;
};
# Load up lastfm scrobbling secret
sops.secrets.lastfm-conf = {
owner = "nathan";
format = "binary";
sopsFile = ../secrets/lastfm.conf;
};
# Same for the scanning service
systemd.user.services.mopidy-scan = {
description = "Mopidy files local scanner";
serviceConfig = {
ExecStart = "${mopidyEnv}/bin/mopidy local scan";
Type = "oneshot";
};
wants = [ "rclone-music.service" ];
};
}

View File

@ -1,20 +0,0 @@
{ config, pkgs, unstable, ... }:
{
# Install synthing and syncthing-tray
environment.systemPackages = with pkgs; [
syncthing
unstable.syncthingtray
];
# Home manager configuration
home-manager.users.nathan = {
# Enable the service for both syncthing and the tray
services.syncthing = {
enable = true;
tray = {
enable = true;
package = unstable.syncthingtray;
command = "syncthingtray --wait";
};
};
};
}

View File

@ -1,56 +0,0 @@
# Basic, must have, command-line utilities
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Basic command line utilities
wget
tmux
nano
unzip
any-nix-shell
htop
# Spell check
hunspell
hunspellDicts.en-us
# Rust rewrites of common shell utilities
starship
exa
bat
fd
sd
du-dust
ripgrep
ripgrep-all
tokei
hyperfine
bottom
dogdns
duf
# CLI Markdown renderer
glow
# Command line file manager
broot
# Much better curl
httpie
# CLI spreadsheets
visidata
# User friendly cut
choose
# Cheatsheet manager
cheat
# Ping with a graph
gping
# Man but terse
tealdeer
# Pandoc for documentation
pandoc
# For nslookup
dnsutils
# Feh image viewer
feh
# Mosh for better high-latency ssh
mosh
# PV for viewing pipes
pv
];
}

View File

@ -1,10 +0,0 @@
{ config, lib, pkgs, ... }:
{
imports = [
./ssh.nix
./fish.nix
./git.nix
];
programs.home-manager.enable = true;
}

3
core.nix Normal file
View File

@ -0,0 +1,3 @@
{ config, lib, pkgs, ... }:
{ }

View File

@ -1,37 +0,0 @@
{ config, pkgs, ... }:
{
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs;
[
openssh
coreutils-full
];
# Use a custom configuration.nix location.
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
# environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# Create /etc/bashrc that loads the nix-darwin environment.
programs.zsh.enable = true; # default shell on catalina
programs.fish.enable = true;
# Give nix packages higher priority than system packages in fish
programs.fish.shellInit = ''
for p in /run/current-system/sw/bin
if not contains $p $fish_user_paths
set -g fish_user_paths $p $fish_user_paths
end
end
'';
# Make nix managed fonts work on macos
fonts.fontDir.enable = true;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
}

View File

@ -1,24 +0,0 @@
# Configure gpg with yubikey support
{ config, pkgs, ... }:
{
# Setup environment for gpg agent
environment.shellInit = ''
export GPG_TTY="$(tty)"
gpg-connect-agent /bye
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
'';
programs = {
# Enable gpg-agent with ssh support
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};
# install gnupg and yubikey personalization
environment.systemPackages = with pkgs; [
gnupg
yubikey-personalization
];
}

View File

@ -1,40 +0,0 @@
{ pkgs, lib, unstable, ... }: {
## Boot, drivers, and host name
# Use grub
boot.loader = {
grub = {
enable = true;
version = 2;
efiSupport = true;
# Go efi only
device = "nodev";
# Use os-prober
useOSProber = true;
};
efi = {
efiSysMountPoint = "/boot/";
canTouchEfiVariables = true;
};
};
# Enable AMD gpu drivers early
boot.initrd.kernelModules = [ "amdgpu" ];
# Use the zen kernel with muqss turned on
boot.kernelPackages =
let
linuxZenWMuQSS = pkgs.linuxPackagesFor (pkgs.linuxPackages_zen.kernel.override {
structuredExtraConfig = with lib.kernel; {
SCHED_MUQSS = yes;
};
ignoreConfigErrors = true;
}
);
in
linuxZenWMuQSS;
## Left over uncategorized packages
environment.systemPackages = with pkgs; [
unstable.firefox-beta-bin
wally-cli
];
# Enable ergodox udev rules
hardware.keyboard.zsa.enable = true;
}

115
droid.nix
View File

@ -1,115 +0,0 @@
{ config, lib, pkgs, unstable, fenix, ... }:
{
system.stateVersion = "21.11";
environment.sessionVariables = {
XDG_RUNTIME_DIR = "/data/data/com.termux.nix/files/home/run";
GDK_DPI_SCALE = "2";
GDK_SCALE = "2";
};
# Get home-manager up and running
home-manager.config = ./home-manager/common.nix;
# Have to put packages here, as it does not have environment.systemPackages
environment.packages = with pkgs;
[
###
## utils-core
###
# Basic command line utilities
wget
tmux
nano
unzip
any-nix-shell
htop
# Spell check
hunspell
hunspellDicts.en-us
# Rust rewrites of common shell utilities
starship
exa
bat
fd
sd
du-dust
ripgrep
ripgrep-all
tokei
hyperfine
unstable.bottom
dogdns
duf
# CLI Markdown renderer
glow
# Command line file manager
broot
# Much better curl
unstable.httpie
# CLI spreadsheets
visidata
# User friendly cut
choose
# Cheatsheet manager
cheat
# Ping with a graph
gping
# Man but terse
tealdeer
# Pandoc for documentation
unstable.pandoc
# For nslookup
dnsutils
# Feh image viewer
feh
# Mosh for better high-latency ssh
mosh
###
## devel-core
###
# Full version of git
git
# Git addons
git-secret
git-lfs
delta
# General development requirements
python3Full
cmake
libtool
gnumake
nixpkgs-fmt
# jq for interacting with JSON
jq
jc
# Viewer for deeply nested JSON
fx
# Direnv for nix-shell niceness
direnv
###
## devel-rust
###
# Use rustup to get the compiler
rustup
# Install the latest rust analyzer
fenix.rust-analyzer
# Sccache for faster builds
# sccache
# Misc cargo utilites
cargo-binutils # Allow invoking the llvm tools included with the toolchain
cargo-edit # Command line Cargo.toml manipulation
cargo-asm # Dump the generated assembly
cargo-fuzz # front end for fuzz testing rust
cargo-license # Audit the licenses of dependencies
cargo-criterion # Benchmarking front end
cargo-audit # Check dependencies for known CVEs
cargo-bloat # Find out what's taking up space in the executable
cargo-udeps # Find unused dependencies
cargo-expand # Dump expanded macros
cargo-play # Quickly execute code outside of a crate
# For building stuff that uses protocol buffers
protobuf
];
}

View File

@ -62,17 +62,16 @@
]
},
"locked": {
"lastModified": 1655120294,
"narHash": "sha256-e0IXVoxH3o1QbLtHxANAg2CHdVE3jZBi5ifhh+6Vpcs=",
"lastModified": 1656648158,
"narHash": "sha256-e4tPuEW8Uj8PEVAYNzr3DPqxY5mGEvnCNyDih8RPP5c=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "29dcfbc1b29ae7281e95367e0f2358b44224a46e",
"rev": "2724625945ddeaeffd94ca56e11b75b98b8bba8b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "29dcfbc1b29ae7281e95367e0f2358b44224a46e",
"type": "github"
}
},
@ -162,11 +161,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1655619932,
"narHash": "sha256-/7L0/ymVXGL0FrQNLAP2P1Ch22RR0kt0N6jfdjm+WVc=",
"lastModified": 1656656878,
"narHash": "sha256-0rA054abuLVzv24nrk4rVWQIDl20T+570UZglPhXgzg=",
"owner": "nix-community",
"repo": "fenix",
"rev": "55987185def5cf3afc616d38907406293a170cfe",
"rev": "e172d625f705ca4013f93d3fe061d3ecf1fc3a34",
"type": "github"
},
"original": {
@ -191,29 +190,13 @@
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"lastModified": 1656065134,
"narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c",
"type": "github"
},
"original": {
@ -256,20 +239,17 @@
},
"home-manager": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"nmd": "nmd",
"nmt": "nmt",
"utils": "utils"
},
"locked": {
"lastModified": 1655679417,
"narHash": "sha256-rUM/VDIQAMm0pLAVBizQoR9I8TELRmak7SsJLaO/NBg=",
"lastModified": 1656367977,
"narHash": "sha256-0hV17V9Up9pnAtPJ+787FhrsPnawxoTPA/VxgjRMrjc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3d8265c5efd5e4d3ad8a90686bc81d49353fdb08",
"rev": "3bf16c0fd141c28312be52945d1543f9ce557bb1",
"type": "github"
},
"original": {
@ -286,11 +266,11 @@
"utils": "utils_2"
},
"locked": {
"lastModified": 1655182547,
"narHash": "sha256-gmkb6l13CVKtlRydDJ9O3sifKtamKLgLdUaEASdQ6Ls=",
"lastModified": 1656122108,
"narHash": "sha256-wJrVZLqvBhq+u2Mi3yc4oS8pOtzdxL6uMmmSt+1bNHE=",
"owner": "nathans-flakes",
"repo": "java",
"rev": "8e53bfead6195e4440aef47b2f08b0e7f89b1d4d",
"rev": "4ade2ae9e949b184ba2d47495ec348f385ab0300",
"type": "github"
},
"original": {
@ -390,11 +370,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1655400192,
"narHash": "sha256-49OBVVRgb9H/PSmNT9W61+NRdDbuSJVuDDflwXlaUKU=",
"lastModified": 1656461576,
"narHash": "sha256-rlmmw6lIlkMQIiB+NsnO8wQYWTfle8TA41UREPLP5VY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3d7435c638baffaa826b85459df0fff47f12317d",
"rev": "cf3ab54b4afe2b7477faa1dd0b65bf74c055d70c",
"type": "github"
},
"original": {
@ -406,11 +386,11 @@
},
"nixpkgs-21_11": {
"locked": {
"lastModified": 1655562720,
"narHash": "sha256-OrN8DkBRZqZMzMuECuQNvSQ5gWoFBCxDvxYXjIQ/pH0=",
"lastModified": 1656198488,
"narHash": "sha256-xe81o3Kin6a0jXA3mTxcR+jeA1jLKw3TCar5LUo/B5c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "27dffce7eaa9648b4a13a461e786f169a17c0889",
"rev": "46af3303651699dc58cfc251d9b18c0f59d857da",
"type": "github"
},
"original": {
@ -422,11 +402,11 @@
},
"nixpkgs-22_05": {
"locked": {
"lastModified": 1655584987,
"narHash": "sha256-YmWxPm6ctu+9nV80DtYtMfOBosNymeTpj8+Z0JTDfhU=",
"lastModified": 1656199498,
"narHash": "sha256-/BCpM7j7y1G4het6Z3idlnv9A87/s0O1glVmH7fnWvk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "57622cb817210146b379adbbd036d3da0d1f367c",
"rev": "72a1f167077060a1a7b6e0104863245d0483fa7f",
"type": "github"
},
"original": {
@ -438,11 +418,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1655567057,
"narHash": "sha256-Cc5hQSMsTzOHmZnYm8OSJ5RNUp22bd5NADWLHorULWQ=",
"lastModified": 1656461576,
"narHash": "sha256-rlmmw6lIlkMQIiB+NsnO8wQYWTfle8TA41UREPLP5VY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e0a42267f73ea52adc061a64650fddc59906fc99",
"rev": "cf3ab54b4afe2b7477faa1dd0b65bf74c055d70c",
"type": "github"
},
"original": {
@ -454,11 +434,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1655456688,
"narHash": "sha256-j2trI5gv2fnHdfUQFBy957avCPxxzCqE8R+TOYHPSRE=",
"lastModified": 1656589841,
"narHash": "sha256-Kqd6r9aNIzjYGhMFYATdKwRbXBCGLcdqAJMLr4I8LG0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d17a56d90ecbd1b8fc908d49598fb854ef188461",
"rev": "dbb62c34bbb5cdf05f1aeab07638b24b0824d605",
"type": "github"
},
"original": {
@ -468,38 +448,6 @@
"type": "github"
}
},
"nmd": {
"flake": false,
"locked": {
"lastModified": 1653339422,
"narHash": "sha256-8nc7lcYOgih3YEmRMlBwZaLLJYpLPYKBlewqHqx8ieg=",
"owner": "rycee",
"repo": "nmd",
"rev": "9e7a20e6ee3f6751f699f79c0b299390f81f7bcd",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmd",
"type": "gitlab"
}
},
"nmt": {
"flake": false,
"locked": {
"lastModified": 1648075362,
"narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=",
"owner": "rycee",
"repo": "nmt",
"rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmt",
"type": "gitlab"
}
},
"nose": {
"flake": false,
"locked": {
@ -598,18 +546,18 @@
},
"polymc": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat",
"libnbtplusplus": "libnbtplusplus",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1655285534,
"narHash": "sha256-g1WTrnRD1YtI2aCVUqatg7NlhmLJ7jIA4p0ke9Zpvx0=",
"lastModified": 1656582643,
"narHash": "sha256-TC7tkdgpvConambYP1yoVjxxixZkMhkrdfHDKMKIyKE=",
"owner": "PolyMC",
"repo": "PolyMC",
"rev": "03e454b71d83aebbb534c5734ccd9093842da28c",
"rev": "286f82cc99322398d720f2bbf88869c42960227d",
"type": "github"
},
"original": {
@ -668,11 +616,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1655591884,
"narHash": "sha256-eBjsdPC5vudbUv4/i7AAggrrTATnCTzMfQetCiJndaQ=",
"lastModified": 1656601302,
"narHash": "sha256-8vlDMdGmccsFkDTM5O3RGRTZIGBEVIDjnXpxWGoVIQc=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "eb9b36075272013984ac5d27128e87a714b90c9a",
"rev": "ce36446943a33b01de50ca27d8d17e176af13cd5",
"type": "github"
},
"original": {
@ -691,11 +639,11 @@
"nixpkgs-22_05": "nixpkgs-22_05"
},
"locked": {
"lastModified": 1655665732,
"narHash": "sha256-Fe+evSlGbMOMNSI9dECLDJx6L3ZvYFxosfaDnaPwSK8=",
"lastModified": 1656399028,
"narHash": "sha256-re66+rVHGR3y+0QsaDAwoAHCfoi3BlGV24t2EqRZsAE=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "67af9b179c629dea211ebd83f92c77f5745043be",
"rev": "d26947f2d6252e2aae5ffddfe9b38b7c4b94e8f9",
"type": "github"
},
"original": {

350
flake.nix
View File

@ -9,7 +9,7 @@
inputs.nixpgks.follows = "nixpkgs";
};
emacs = {
url = "github:nix-community/emacs-overlay/29dcfbc1b29ae7281e95367e0f2358b44224a46e";
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
mozilla = {
@ -56,245 +56,131 @@
, polymc
, nix-doom-emacs
, java
}@attrs:
}@inputs:
let
baseModules = [
./applications/utils-core.nix
## Setup binary caches and other common nix config
({ pkgs, ... }: {
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# First install cachix, so we can discover new ones
environment.systemPackages = [ pkgs.cachix ];
# Then configure up the nix community cache
nix = {
binaryCaches = [
"https://nix-community.cachix.org"
];
binaryCachePublicKeys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# Turn on flakes support (from within a flake, lamo)
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
# Setup overlays
nixpkgs.overlays = [ emacs.overlay polymc.overlay ];
})
];
sopsModules = [
sops-nix.nixosModules.sops
## Setup sops
({ pkgs, config, ... }: {
# Add default secrets
sops.defaultSopsFile = ./secrets/nathan.yaml;
# Use system ssh key as an age key
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
})
];
coreModules = baseModules ++ sopsModules ++ [
./modules/common.nix
./modules/ssh.nix
home-manager.nixosModules.home-manager
# Configure system state version for linux
({ pkgs, ... }: {
# System state version for compat
system.stateVersion = "21.11";
})
];
setHomeManagerVersions = ({ pkgs, config, unstable, ... }: {
home-manager.users.nathan.programs = {
starship.package = unstable.starship;
git.package = unstable.gitFull;
fish.package = unstable.fish;
makeNixosSystem = { system, hostName, extraModules ? [ ], ourNixpkgs ? nixpkgs }: ourNixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inputs = inputs;
};
});
baseHomeModules = [
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.nathan = import ./home-manager/common.nix;
};
}
setHomeManagerVersions
./home.nix
];
desktopModules = baseHomeModules ++ coreModules ++ [
./modules/audio.nix
./modules/sway.nix
./modules/fonts.nix
./modules/gpg.nix
./modules/logitech.nix
./modules/qemu.nix
./modules/docker.nix
./modules/printing.nix
./modules/zt.nix
./modules/lxc.nix
./modules/tailscale.nix
./modules/protonmail.nix
./applications/communications.nix
./applications/devel-core.nix
./applications/devel-core-linux.nix
./applications/devel-rust.nix
./applications/devel-raku.nix
./applications/devel-kotlin.nix
./applications/devel-js.nix
./applications/emacs.nix
./applications/image-editing.nix
./applications/media.nix
./applications/syncthing.nix
./desktop.nix
];
serverModules = baseHomeModules ++ coreModules ++ [
./home-linux.nix
./modules/zt.nix
./modules/autoupdate.nix
./modules/tailscale.nix
./applications/devel-core.nix
./applications/devel-core-linux.nix
];
mozillaOverlay = import "${mozilla}";
in
{
nixosConfigurations = {
levitation = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
unstable = import nixpkgs-unstable {
config = { allowUnfree = true; };
overlays = [ mozillaOverlay ];
system = "x86_64-linux";
modules = [
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
./modules/default.nix
({ pkgs, lib, ... }: {
# Configure hostname
networking = {
hostName = hostName;
};
doomEmacs = nix-doom-emacs.hmModule;
} // attrs;
modules = [
./hardware/levitation.nix
./machines/levitation.nix
./modules/games.nix
./home-linux.nix
] ++ desktopModules;
};
oracles = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
unstable = import nixpkgs-unstable {
config = { allowUnfree = true; };
overlays = [ ];
system = "x86_64-linux";
# Setup sops
# Add default secrets
sops = {
defaultSopsFile = ./secrets/nathan.yaml;
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
};
} // attrs;
modules = [
./hardware/oracles.nix
./machines/oracles.nix
./applications/devel-rust.nix
./modules/docker.nix
./system-specific/oracles/matrix.nix
./system-specific/oracles/gitlab-runner.nix
./system-specific/oracles/gitea.nix
./system-specific/oracles/minecraft.nix
] ++ serverModules;
};
perception = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
unstable = import nixpkgs-unstable {
config = { allowUnfree = true; };
overlays = [ ];
system = "x86_64-linux";
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = (pkg: true);
# Home manager configuration
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
inputs = inputs;
};
sharedModules = [
./home-manager/default.nix
];
};
} // attrs;
modules = [
./hardware/perception.nix
./machines/perception.nix
./applications/devel-rust.nix
./modules/docker.nix
./system-specific/perception/plex.nix
] ++ serverModules;
};
shadowchild = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
unstable = import nixpkgs-unstable {
config = { allowUnfree = true; };
overlays = [ ];
system = "x86_64-linux";
};
} // attrs;
modules = [
./hardware/shadowchild.nix
./machines/shadowchild.nix
./modules/docker.nix
] ++ serverModules;
};
matrix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
unstable = import nixpkgs-unstable {
config = { allowUnfree = true; };
overlays = [ ];
system = "x86_64-linux";
};
} // attrs;
modules = [
./hardware/matrix.nix
./machines/matrix.nix
./modules/docker.nix
./system-specific/matrix/matrix.nix
./system-specific/matrix/gitea.nix
] ++ serverModules;
};
x86vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
unstable = import nixpkgs-unstable {
config = { allowUnfree = true; };
overlays = [ ];
system = "x86_64-linux";
};
} // attrs;
modules = [ ./home-linux.nix ] ++ desktopModules;
};
})
] ++ extraModules;
};
darwinConfigurations = {
"Nathans-MacBook-Pro" = darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs = {
unstable = import nixpkgs-unstable {
config = { allowUnfree = true; };
overlays = [ ];
system = "x86_64-darwin";
};
doomEmacs = nix-doom-emacs.hmModule;
} // attrs;
modules = baseModules ++ baseHomeModules ++ [
./darwin-modules/base.nix
home-manager.darwinModules.home-manager
./modules/fonts.nix
./darwin-modules/gpg.nix
./applications/devel-core.nix
./applications/devel-rust.nix
./applications/emacs.nix
in
rec {
nixosConfigurations = {
levitation = makeNixosSystem {
system = "x86_64-linux";
hostName = "levitation";
extraModules = [
./hardware/levitation.nix
({ pkgs, config, lib, ... }: {
boot.loader = {
grub = {
enable = true;
version = 2;
efiSupport = true;
# Go efi only
devices = [ "nodev" ];
# Use os-prober
useOSProber = true;
};
efi = {
efiSysMountPoint = "/boot/";
canTouchEfiVariables = false;
};
};
# Setup system configuration
nathan = {
programs = {
games = true;
};
config = {
isDesktop = true;
nix.autoUpdate = false;
};
};
# Configure networking
networking = {
domain = "mccarty.io";
useDHCP = false;
interfaces.enp6s0.useDHCP = true;
nat.externalInterface = "enp6s0";
# Open ports for soulseek
# TODO add in soulseek
firewall = {
allowedTCPPorts = [ 61377 ];
allowedUDPPorts = [ 61377 ];
};
};
# FIXME borg backup module
# Setup home manager
home-manager.users.nathan = { config, lib, pkgs, ... }: {
# Module configuration
nathan = {
config = {
isDesktop = true;
};
};
};
})
];
};
x86vm = makeNixosSystem {
system = "x86_64-linux";
hostName = "x86vm";
extraModules = [
"${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
({ pkgs, config, lib, ... }: {
nathan = {
programs = {
games = true;
};
config = {
isDesktop = true;
nix.autoUpdate = false;
};
};
home-manager.users.nathan = import ./home-manager/machines/x86vm.nix;
# Workaround to get sway working in qemu
environment.variables = {
"WLR_RENDERER" = "pixman";
};
})
];
};
};
homeConfigurations.linux =
let
system = "x86_64-linux";
in
home-manager.lib.homeManagerConfiguration {
configuration = import ./home-manager/linux.nix;
inherit system;
username = "nathan";
homeDirectory = "/home/nathan";
stateVersion = "21.11";
};
};
}

View File

@ -1,80 +0,0 @@
{ pkgs, config, unstable, ... }:
{
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
## Linux specific user configuration
users = {
mutableUsers = false;
users.nathan = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "audio" "docker" "libvirtd" "uinput" "adbusers" "plugdev" ];
hashedPassword = "$6$ShBAPGwzKZuB7eEv$cbb3erUqtVGFo/Vux9UwT2NkbVG9VGCxJxPiZFYL0DIc3t4GpYxjkM0M7fFnh.6V8MoSKLM/TvOtzdWbYwI58.";
openssh.authorizedKeys.keys = [
# yubikey ssh key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRs6zVljIlQEZ8F+aEBqqbpeFJwCw3JdveZ8TQWfkev cardno:000615938515"
# Macbook pro key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGBfkO7kq37RQMT8UE8zQt/vP4Ub7kizLw6niToJwAIe nathan@Nathans-MacBook-Pro.local"
# Phone key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILY7KmG/eFm3hgTx7GBB5jNrV/yryg5C6xcgCxFQhn+o JuiceSSH"
# Tablet key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMd+LlxJnluU0xvIMRIz74iypKfcSpQ5/7y2SB4c6SFY JuiceSSH"
];
};
};
# enable sudo
security.sudo.enable = true;
home-manager = {
users.nathan = {
# Alacritty configuration
programs.alacritty = {
enable = true;
settings = {
env = {
TERM = "xterm-256color";
ALACRITTY = "1";
};
font = {
normal.family = "FiraCode Nerd Font";
bold.family = "FiraCode Nerd Font";
italic.family = "FiraCode Nerd Font";
bold_italic.family = "FiraCode Nerd Font";
size = 9.0;
};
colors = {
primary = {
background = "0x103c48";
foreground = "0xadbcbc";
};
normal = {
black = "0x184956";
red = "0xfa5750";
green = "0x75b938";
yellow = "0xdbb32d";
blue = "0x4695f7";
magenta = "0xf275be";