Compare commits

...

8 commits

37 changed files with 266 additions and 203 deletions

View file

@ -8,33 +8,23 @@
config.easy-hosts = {
shared.specialArgs.marleylib = import ../lib;
### Module Imports ###
# TODO: Move module imports to custom module
shared.modules = with inputs; [
lix.nixosModules.default
agenix.nixosModules.default
{
home-manager.sharedModules = [
nixcord.homeModules.nixcord
];
}
];
# shared.modules = with inputs; [
# # TODO: Move module imports to custom module
# {
# home-manager.sharedModules = [
# nixcord.homeModules.nixcord
# ];
# }
# ];
perClass = class: {
modules = ["${self}/modules/${class}/default.nix"];
# modules = with inputs;
# (nixpkgs.lib.optionals (class == "nixos") [
# home-manager.nixosModules.home-manager
# agenix.nixosModules.default
# stylix.nixosModules.stylix
# niri-flake.nixosModules.niri
# ])
# ++ (nixpkgs.lib.optionals (class == "darwin") [
# home-manager.darwinModules.home-manager
# agenix.darwinModules.default
# stylix.darwinModules.stylix
# ]);
};

View file

@ -1,4 +1,6 @@
{config, ...}: {
{config, ...}: let
inherit (config.marleyos.my) name;
in {
networking = {
computerName = "mairley";
hostName = "mairley";
@ -10,8 +12,8 @@
};
users = {
knownUsers = ["marley"];
users."marley" = {
knownUsers = [name];
users."${name}" = {
# This is required for some reason.
uid = 501;
@ -19,5 +21,9 @@
};
};
home-manager.users."${name}" = {
home.stateVersion = "24.05";
};
system.stateVersion = 5;
}

View file

@ -1,4 +1,6 @@
{
{config, ...}: let
inherit (config.marleyos.my) name;
in {
imports = [./hardware-configuration.nix];
networking.hostName = "marleycentre";
@ -25,5 +27,9 @@
allowedUDPPorts = [6881];
};
home-manager.users."${name}" = {
home.stateVersion = "24.05";
};
system.stateVersion = "24.05";
}

View file

@ -1,4 +1,6 @@
{
{config, ...}: let
inherit (config.marleyos.my) name;
in {
imports = [./hardware-configuration.nix];
networking.hostName = "marleynet";
@ -23,5 +25,9 @@
services.openssh.ports = [222];
home-manager.users."${name}" = {
home.stateVersion = "24.05";
};
system.stateVersion = "24.05";
}

View file

@ -1,5 +1,10 @@
{marleylib, ...}: let
{
marleylib,
config,
...
}: let
inherit (marleylib.module) enabled;
inherit (config.marleyos.my) name;
in {
imports = [./hardware-configuration.nix ./mounts.nix ./autorandr.nix];
@ -10,12 +15,19 @@ in {
marleyos = {
profiles = {
desktop = enabled;
hardware.nvidia = enabled;
desktop = true;
};
hardware = {
nvidia = enabled;
};
mounts.babeshare = enabled;
};
home-manager.users."${name}" = {
home.stateVersion = "24.05";
};
system.stateVersion = "24.05";
}

View file

@ -3,6 +3,9 @@
../options
./nix.nix
./stylix
./programs
./home.nix
];

View file

@ -1,62 +1,68 @@
{
pkgs,
inputs,
pkgs,
...
}: {
nix = {
package = pkgs.lix;
imports = [
inputs.lix.nixosModules.default # this is universal, despite the 'nixos'
];
# Pin system <nixpkgs> to flake nixpkgs version.
# i.e. for use in pkgs = import <nixpkgs> {}.
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
config = {
nix = {
package = pkgs.lix;
# Pin flake registry nixpkgs to flake nixpkgs version.
# i.e. for use in nix search nixpkgs.
registry = {
nixpkgs.flake = inputs.nixpkgs;
# Pin system <nixpkgs> to flake nixpkgs version.
# i.e. for use in pkgs = import <nixpkgs> {}.
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
# Pin flake registry nixpkgs to flake nixpkgs version.
# i.e. for use in nix search nixpkgs.
registry = {
nixpkgs.flake = inputs.nixpkgs;
};
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = [
"root"
# @wheel/@admin are added in OS specific modules.
];
# Set up caches.
extra-substituters = [
"https://marleyos.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# Disable that annoying "git tree is dirty" warning.
warn-dirty = false;
auto-optimise-store = true;
use-xdg-base-directories = true;
};
# Garbage collection.
gc.automatic = true;
# More useful repl.
environment.systemPackages = let
nrepl =
pkgs.writeShellScriptBin "nrepl"
# sh
''
nix repl "${toString ./.}/repl.nix" "$@"
'';
in [
nrepl
];
};
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = [
"root"
# @wheel/@admin are added in OS specific modules.
];
# Set up caches.
extra-substituters = [
"https://marleyos.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# Disable that annoying "git tree is dirty" warning.
warn-dirty = false;
auto-optimise-store = true;
use-xdg-base-directories = true;
};
# Garbage collection.
gc.automatic = true;
# More useful repl.
environment.systemPackages = let
nrepl =
pkgs.writeShellScriptBin "nrepl"
# sh
''
nix repl "${toString ./.}/repl.nix" "$@"
'';
in [
nrepl
];
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./fish.nix
];
}

View file

@ -10,10 +10,7 @@ in {
config = lib.mkIf cfg.enable {
programs.fish = {
enable = true;
useBabelfish = true;
};
environment.shells = [config.programs.fish.package];
};
}

View file

@ -0,0 +1,21 @@
{pkgs, ...}: {
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml";
override = {slug = "rose-pine";};
image = ./wallpaper.png;
fonts = {
monospace = {
package = pkgs.maple-mono-NF;
name = "Maple Mono";
};
sizes = {
terminal = 11;
};
};
};
}

View file

Before

Width:  |  Height:  |  Size: 4.7 MiB

After

Width:  |  Height:  |  Size: 4.7 MiB

View file

@ -2,5 +2,6 @@
imports = [
./home.nix
./nix.nix
./stylix.nix
];
}

View file

@ -1,7 +1,15 @@
{config, ...}: let
{
config,
inputs,
...
}: let
inherit (config.marleyos.my) name;
in {
home-manager.users."${name}" = {
home.homeDirectory = "/Users/${name}";
imports = [inputs.home-manager.darwinModules.home-manager];
config = {
home-manager.users."${name}" = {
home.homeDirectory = "/Users/${name}";
};
};
}

View file

@ -0,0 +1,3 @@
{inputs, ...}: {
imports = [inputs.stylix.darwinModules.stylix];
}

View file

@ -1,6 +1,10 @@
{
{inputs, ...}: {
imports = [
inputs.agenix.darwinModules.default
../base
./base
./programs
];
}

View file

@ -0,0 +1,5 @@
{
imports = [
./fish.nix
];
}

View file

@ -0,0 +1,11 @@
{
config,
lib,
...
}: let
cfg = config.marleyos.programs.fish;
in {
config = lib.mkIf cfg.enable {
environment.shells = [config.programs.fish.package];
};
}

View file

@ -4,10 +4,6 @@ in {
marleyos = {
profiles = {
inherit (cfg.profiles) desktop server;
hardware = {
inherit (cfg.profiles.hardware) nvidia;
};
};
my = {

View file

@ -2,10 +2,13 @@
imports = [
./boot.nix
./drivers.nix
./fonts.nix
./home.nix
./i18n.nix
./mounts
./networking.nix
./nix.nix
./stylix.nix
./users.nix
];
}

View file

@ -0,0 +1,10 @@
{pkgs, ...}: {
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
corefonts
noto-fonts
];
};
}

View file

@ -1,7 +1,14 @@
{config, ...}: let
{
config,
inputs,
...
}: let
inherit (config.marleyos.my) name;
in {
home-manager.users."${name}" = {
home.homeDirectory = "/home/${name}";
imports = [inputs.home-manager.nixosModules.home-manager];
config = {
home-manager.users."${name}" = {
home.homeDirectory = "/home/${name}";
};
};
}

View file

@ -0,0 +1,7 @@
{
boot.supportedFilesystems = {
ntfs = true;
};
services.udisks2.enable = true;
}

View file

@ -0,0 +1,6 @@
{
imports = [
./automounts.nix
./babeshare.nix
];
}

View file

@ -0,0 +1,33 @@
{
inputs,
pkgs,
...
}: {
imports = [inputs.stylix.nixosModules.stylix];
config = {
stylix = {
enable = true;
fonts = {
serif = {
package = pkgs.eb-garamond;
name = "EB Garamond";
};
sansSerif = {
package = pkgs.dm-sans;
name = "DeepMind Sans";
};
emoji = {
package = pkgs.whatsapp-emoji-font;
name = "Apple Color Emoji";
};
};
cursor = {
package = pkgs.rose-pine-cursor;
name = "BreezeX-RosePine-Linux";
};
};
};
}

View file

@ -1,7 +1,12 @@
{
{inputs, ...}: {
imports = [
inputs.agenix.nixosModules.default
../base
./base
./hardware
./programs
];
}

View file

@ -1,11 +1,11 @@
{
pkgs,
config,
lib,
config,
pkgs,
...
}: {
config = lib.mkIf (!config.marleyos.profiles.server) {
security.rtkit.enable = true; # Used for pulseaudio.
security.rtkit.enable = true; # for pulseaudio
hardware.pulseaudio.enable = false;
@ -15,8 +15,6 @@
alsa.enable = true;
pulse.enable = true;
};
printing.enable = true;
};
environment.systemPackages = [pkgs.pwvucontrol];

View file

@ -0,0 +1,8 @@
{
imports = [
./audio.nix
./nvidia.nix
./misc.nix # try to use this as little as possible
];
}

View file

@ -0,0 +1,3 @@
{
services.printing.enable = true;
}

View file

@ -3,9 +3,9 @@
config,
...
}: let
cfg = config.marleyos.nvidia;
cfg = config.marleyos.hardware.nvidia;
in {
options.marleyos.nvidia.enable = lib.mkEnableOption "nvidia";
options.marleyos.hardware.nvidia.enable = lib.mkEnableOption "nvidia";
config = lib.mkIf cfg.enable {
# NVIDIA drivers are unfree.

View file

@ -0,0 +1,5 @@
{
imports = [
./fish.nix
];
}

View file

@ -5,14 +5,7 @@
}: let
cfg = config.marleyos.programs.fish;
in {
options.marleyos.programs.fish.enable = lib.mkEnableOption "fish";
config = lib.mkIf cfg.enable {
programs.fish = {
enable = true;
useBabelfish = true;
};
users.defaultUserShell = config.programs.fish.package;
};
}

View file

@ -2,9 +2,5 @@
options.marleyos.profiles = {
desktop = lib.mkEnableOption "graphical desktop profile";
server = lib.mkEnableOption "server profile";
hardware = {
nvidia = lib.mkEnableOption "Nvidia profile";
};
};
}

View file

@ -1,16 +0,0 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.marleyos.appearance.base;
in {
options.marleyos.appearance.base.enable = lib.mkEnableOption "base";
config = lib.mkIf cfg.enable {
fonts.packages = with pkgs; [
maple-mono-NF
];
};
}

View file

@ -1,58 +0,0 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.marleyos.appearance.base;
in {
options.marleyos.appearance.base.enable = lib.mkEnableOption "base";
config = lib.mkIf cfg.enable {
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml";
override = {slug = "rose-pine";};
image = ./wallpaper.png;
fonts = {
serif = {
package = pkgs.eb-garamond;
name = "EB Garamond";
};
sansSerif = {
package = pkgs.dm-sans;
name = "DeepMind Sans";
};
monospace = {
package = pkgs.maple-mono-NF;
name = "Maple Mono";
};
emoji = {
package = pkgs.whatsapp-emoji-font;
name = "Apple Color Emoji";
};
sizes = {
terminal = 11;
};
};
cursor = {
package = pkgs.rose-pine-cursor;
name = "BreezeX-RosePine-Linux";
};
};
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
corefonts
noto-fonts
];
};
};
}

View file

@ -1,17 +0,0 @@
{
lib,
config,
...
}: let
cfg = config.marleyos.mounts.automounts;
in {
options.marleyos.mounts.automounts.enable = lib.mkEnableOption "automounts";
config = lib.mkIf cfg.enable {
boot.supportedFilesystems = {
ntfs = true;
};
services.udisks2.enable = true;
};
}