fix natalie config so it builds successfully

This commit is contained in:
chloe caruso 2025-05-06 17:20:37 -07:00
parent c0cfb69f27
commit 8bd9e070d0
21 changed files with 210 additions and 152 deletions

View file

@ -2,7 +2,6 @@
description = "New Modular flake!";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
# nixpkgs.url = "github:NixOS/nixpkgs/master";
nixpkgs-stable.url = "nixpkgs/nixos-23.11";
home-manager.url = "github:nix-community/home-manager/master";
@ -77,35 +76,19 @@
)
];
# ----- USER SETTINGS ----- #
users.nmarks = rec {
#enable if you want to use a tiling wm on macos
darwinTiling = true;
username = "nmarks"; # username
name = "Natalie"; # name/identifier
email = "nmarks413@gmail.com"; # email (used for certain configurations)
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
theme = "catppuccin-mocha"; #name of theme that stylix will use
browser = "firefox"; # Default browser; must select one from ./user/app/browser/
term = "ghostty"; # Default terminal command;
font = "iosevka"; # Selected font
editor = "neovim"; # Default editor;
spawnEditor = "exec" + term + " -e " + editor;
timeZone = "America/Los_Angeles";
sexuality = "bisexual";
};
mkSystem = import ./lib/mkSystem.nix {
inherit overlays nixpkgs inputs;
};
in {
in rec {
# "nix run .#darwin-rebuild"
packages.aarch64-darwin.darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;
# "nix fmt ."
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.alejandra;
# natalie's desktop computer
nixosConfigurations.nixos = mkSystem "nixos" {
user = "nmarks";
user = "natalie";
host = "desktop";
system = "x86_64-linux";
extraModules = [
@ -114,7 +97,7 @@
};
# natalie's laptop
darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {
user = "nmarks";
user = "natalie";
host = "laptop";
system = "aarch64-darwin";
};
@ -131,5 +114,13 @@
host = "paperback";
system = "aarch64-darwin";
};
# generate checks for "nix flake check --all-systems --no-build"
checks.aarch64-darwin = builtins.listToAttrs (builtins.map (name: let
d = darwinConfigurations.${name}.system;
in {
name = "darwinConfiguration-" + d.name;
value = d;
}) (builtins.attrNames darwinConfigurations));
};
}

View file

@ -44,24 +44,25 @@
currentSystem = system;
# Details about the host machine
host = {
inherit darwin;
inherit darwin name;
};
user = ({
# This acts as formal documentation for what is allowed in user.nix
username, # unix username
name, # your display name
email, # for identity in programs such as git
dotfilesDir, # location to `../.`
timeZone ? "America/Los_Angeles",
# Stylix/Theming
theme ? null, # theme name for stylix
sexuality ? null, # pride flag for hyfetch
term, # preferred $TERM
editor, # preferred $EDITOR
browser ? null, # preferred $BROWSER
}@user: user) userConfig;
# This acts as formal documentation for what is allowed in user.nix
username, # unix username
name, # your display name
email, # for identity in programs such as git
dotfilesDir, # location to `../.`
timeZone ? "America/Los_Angeles",
# Stylix/Theming
theme ? null, # theme name for stylix
sexuality ? null, # pride flag for hyfetch
font ? null, # font to use
term, # preferred $TERM
editor, # preferred $EDITOR
browser ? null, # preferred $BROWSER
} @ user:
user)
userConfig;
};
systemSettings = rec {
inherit darwin;

View file

@ -69,7 +69,8 @@ in {
}
];
shellAliases =
{ } // lib.optionalAttrs (!host.darwin) {
{}
// lib.optionalAttrs (!host.darwin) {
reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
};
shellInit = ''

View file

@ -8,6 +8,13 @@
./mac-app-store.nix
./system.nix
./icons.nix
./tiling
# sort-lines: end
];
# make 'shared.linux' not an error to define.
options.shared.linux = lib.mkOption {
type = lib.types.anything;
default = {};
description = "no-op on darwin";
};
}

View file

@ -3,7 +3,9 @@
pkgs,
lib,
...
}: {
}: let
tiling = config.shared.darwin.tiling.enable;
in {
# Use touchid or watch to activate sudo
security.pam.services.sudo_local = {
enable = true;
@ -51,8 +53,8 @@
NSDocumentSaveNewDocumentsToCloud = false;
AppleICUForce24HourTime = true;
#Autohide menu bar
#_HIHideMenuBar = config.shared.darwin.tiling;
# Autohide menu bar for tiling window manager
_HIHideMenuBar = tiling;
};
# minimal dock
dock = {

View file

@ -1,6 +1,6 @@
{pkgs, ...}: {
{config,pkgs, ...}: {
services.aerospace = {
enable = true;
enable = config.shared.darwin.tiling.enable;
settings = {
# Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization
enable-normalization-flatten-containers = true;

View file

@ -1,2 +1,16 @@
{pkgs, ...}: {
{ lib, ... }: let
inherit (lib) types;
in {
imports = [
./sketchybar.nix
./aerospace.nix
];
options = {
shared.darwin.tiling.enable = lib.mkOption {
type = types.bool;
default = false;
example = true;
description = "Enable tiling window management.";
};
};
}

View file

@ -1,6 +1,6 @@
{pkgs, ...}: {
{config,pkgs, ...}: {
services.sketchybar = {
enable = true;
enable = config.shared.darwin.tiling.enable;
config = ''
# This is a demo config to showcase some of the most important commands.
# It is meant to be changed and configured, as it is intentionally kept sparse.

View file

@ -1,8 +1,14 @@
{pkgs, ...}: {
{ lib, pkgs, ... }: {
imports = [
./boot.nix
./ld.nix
./nvidia.nix
./services.nix
];
# make 'shared.darwin' not an error to define.
options.shared.darwin = lib.mkOption {
type = lib.types.anything;
default = {};
description = "no-op on linux";
};
}

View file

@ -1,14 +1,21 @@
# applies user settings for the system
{ pkgs, user, lib, ... }: {
{
pkgs,
user,
lib,
...
}: {
# Set your time zone.
time.timeZone = user.timeZone;
home-manager.users.${user.username}.home.sessionVariables = {
EDITOR = user.editor;
TERMINAL = user.term;
} // lib.optionalAttrs (user ? "browser") {
BROWSER = user.browser;
};
home-manager.users.${user.username}.home.sessionVariables =
{
EDITOR = user.editor;
TERMINAL = user.term;
}
// lib.optionalAttrs (user ? "browser") {
BROWSER = user.browser;
};
stylix = {
enable = false;

View file

@ -1,10 +1,35 @@
# nix config
meow.
this setup allows natalie and chloe to share common configuration between their machines, but also share useful modules between each other.
```
lib/ # reusable functions
modules/ # reusable modules
+-- macos/ # nix-darwin configurations
+-- nixos/ # linux configurations
+-- nixvim/ # neovim configurations
+-- shared/ # shared between nixos-rebuild & nixos-rebuild
+-- home-manager.nix # home program presets
users/
+-- chloe/
| +-- user.nix # info about her
| +-- configuration.nix # for all hosts
| +-- home.nix # for all hosts
| +-- sandwich/
| | +-- configuration.nix # per host
| | +-- home.nix
| +-- paperback/
| ...
+-- natalie/
+-- user.nix # info about her
...
```
A new machine can be added by adding a new definition in `flake.nix`. Note that the user and host `configuration.nix` and `home.nix` files are
## macOS installation instructions
Install Nix using the upstream nix (Pick "no" then "yes):
Install Nix using the upstream Nix (Pick "no" then "yes):
```
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \

View file

@ -1,18 +1,18 @@
# Configuration applied to all of chloe's machines
{
pkgs,
userSettings,
...
}: {
{ pkgs, ... }: {
# packages for all machines
environment.systemPackages = with pkgs; [
neovim
];
# configuration for shared modules.
# all custom options in 'shared' for clarity.
shared.darwin = {
macAppStoreApps = [
"adguard"
"magnet"
];
};
# system preferences
system.defaults = {
NSGlobalDomain = {
KeyRepeat = 1;

View file

@ -14,5 +14,5 @@
# Default terminal command. NOTE: ghostty is not installed for you
term = "ghostty"; # preferred $TERMINAL
editor = "nvim"; # preferred $EDITOR
editor = "nvim"; # preferred $EDITOR
}

View file

@ -1 +1,17 @@
services.tailscale.enable = true;
# Applied to all systems
{pkgs, ...}: {
services.tailscale.enable = true;
fonts.packages = with pkgs; [
nerd-fonts.fira-code
nerd-fonts.iosevka
iosevka
nerd-fonts.symbols-only
nerd-fonts.iosevka
];
# configuration for shared modules.
# all custom options in 'shared' for clarity.
shared.darwin = {
tiling.enable = true; # use tiling window manager
};
}

View file

@ -1,7 +1,7 @@
{
pkgs,
userSettings,
systemSettings,
user,
host,
...
}: {
imports = [
@ -16,7 +16,7 @@
enable = true;
# Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = [userSettings.username];
polkitPolicyOwners = [user.username];
};
noisetorch.enable = true;
@ -75,7 +75,7 @@
libvirtd.enable = true;
};
nix.settings.trusted-users = ["root" userSettings.username];
nix.settings.trusted-users = ["root" user.username];
systemd = {
targets = {
sleep.enable = false;
@ -129,10 +129,10 @@
# Define a user account. Don't forget to set a password with passwd.
# users.defaultUserShell = pkgs.fish;
users.users.${userSettings.username} = {
users.users.${user.username} = {
shell = pkgs.fish;
isNormalUser = true;
description = "Natalie Marks";
description = user.name;
extraGroups = ["networkmanager" "wheel" "docker"];
# openssh.authorizedKeys.keyFiles = ["~/.ssh/id_ed25519.pub"];
packages = with pkgs; [
@ -153,7 +153,7 @@
};
networking = {
hostName = systemSettings.host; # Define your hostname.
hostName = host.name; # Define your hostname.
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
networkmanager.enable = true;
firewall = {

View file

@ -6,9 +6,7 @@
userSettings,
systemSettings,
...
}: let
shared-programs = import ../../modules/shared/homeManagerPrograms.nix {inherit inputs config pkgs lib userSettings systemSettings;};
in {
}: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
#set up nixvim
@ -17,56 +15,48 @@ in {
home = {
stateVersion = "23.05"; # Please read the comment before changing.
packages = with pkgs; let
shared-packages = import ../../modules/shared/packages.nix {inherit pkgs systemSettings;};
in
shared-packages
++ [
#building macos apps hard :(
ghostty
stremio
julia
qbittorrent
packages = with pkgs; [
#building macos apps hard :(
ghostty
stremio
julia
qbittorrent
#gaming
bottles
lutris
mangohud
dxvk_2
steam-run
vulkan-tools
path-of-building
wineWowPackages.stable
winetricks
(prismlauncher.override {gamemodeSupport = true;})
#gaming
bottles
lutris
mangohud
dxvk_2
steam-run
vulkan-tools
path-of-building
wineWowPackages.stable
winetricks
(prismlauncher.override {gamemodeSupport = true;})
#window manager stuff
wofi
xorg.xauth
#linux tools
legcord
pavucontrol
ethtool
grub2
efibootmgr
distrobox
xdg-desktop-portal-gtk
xclip
kdePackages.dolphin
#broken on macos
calibre
mpv
wireguard-tools
signal-desktop
]
++ [
inputs.zls.packages.x86_64-linux.zls
rust-bin.stable.latest.default
];
#window manager stuff
wofi
xorg.xauth
#linux tools
legcord
pavucontrol
ethtool
grub2
efibootmgr
distrobox
xdg-desktop-portal-gtk
xclip
kdePackages.dolphin
#broken on macos
calibre
mpv
wireguard-tools
signal-desktop
inputs.zls.packages.x86_64-linux.zls
rust-bin.stable.latest.default
];
# programs.mangohud.enable = true;
};
programs = shared-programs;
# xdg.mimeApps.defaultApplications."inode/directory" = "dolphin.desktop";
}

View file

@ -1,19 +1,16 @@
{
pkgs,
lib,
}: {
# sort-lines:start
atuin.enable = true;
bat.enable = true;
hyfetch.enable = true;
direnv.enable = true;
# sort-lines:end
...
} @ args: {
programs = {
# sort-lines:start
atuin.enable = true;
bat.enable = true;
hyfetch.enable = true;
direnv.enable = true;
# sort-lines:end
};
fonts.packages = with pkgs; [
nerd-fonts.fira-code
nerd-fonts.iosevka
iosevka
nerd-fonts.symbols-only
nerd-fonts.iosevka
];
home.packages = import ./packages.nix args;
}

View file

@ -1,8 +1,4 @@
{
pkgs,
userSettings,
...
}: {
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
neovim
pinentry_mac

View file

@ -3,8 +3,8 @@
config,
pkgs,
lib,
userSettings,
systemSettings,
user,
host,
...
} @ args: {
imports = [
@ -12,14 +12,9 @@
#set up nixvim
# ../../modules/nixvim
];
programs = import ./home-programs.nix args;
home = {
inherit (userSettings) username;
# shell = pkgs.fish;
stateVersion = "23.05"; # Please read the comment before changing.
packages = pkgs.callPackage ../../modules/shared/packages.nix {inherit systemSettings;};
# shell = pkgs.fish;
sessionPath = [
"$HOME/.emacs.d/bin"

View file

@ -1,8 +1,5 @@
{
pkgs,
systemSettings,
...
}:
# Packages installed with home-manager
{pkgs, ...}:
with pkgs; [
#general development
just

13
users/natalie/user.nix Normal file
View file

@ -0,0 +1,13 @@
rec {
username = "nmarks"; # username
name = "Natalie"; # name/identifier
email = "nmarks413@gmail.com"; # email (used for certain configurations)
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
theme = "catppuccin-mocha"; #name of theme that stylix will use
browser = "firefox"; # Default browser; must select one from ./user/app/browser/
term = "ghostty"; # Default terminal command;
font = "iosevka"; # Selected font
editor = "neovim"; # Default editor;
timeZone = "America/Los_Angeles";
sexuality = "bisexual";
}