Compare commits

..

8 commits

37 changed files with 266 additions and 203 deletions

View file

@ -8,33 +8,23 @@
config.easy-hosts = { config.easy-hosts = {
shared.specialArgs.marleylib = import ../lib; shared.specialArgs.marleylib = import ../lib;
### Module Imports ### # shared.modules = with inputs; [
# TODO: Move module imports to custom module # # TODO: Move module imports to custom module
shared.modules = with inputs; [ # {
lix.nixosModules.default # home-manager.sharedModules = [
agenix.nixosModules.default # nixcord.homeModules.nixcord
# ];
{ # }
home-manager.sharedModules = [ # ];
nixcord.homeModules.nixcord
];
}
];
perClass = class: { perClass = class: {
modules = ["${self}/modules/${class}/default.nix"]; modules = ["${self}/modules/${class}/default.nix"];
# modules = with inputs; # modules = with inputs;
# (nixpkgs.lib.optionals (class == "nixos") [ # (nixpkgs.lib.optionals (class == "nixos") [
# home-manager.nixosModules.home-manager
# agenix.nixosModules.default
# stylix.nixosModules.stylix
# niri-flake.nixosModules.niri # niri-flake.nixosModules.niri
# ]) # ])
# ++ (nixpkgs.lib.optionals (class == "darwin") [ # ++ (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 = { networking = {
computerName = "mairley"; computerName = "mairley";
hostName = "mairley"; hostName = "mairley";
@ -10,8 +12,8 @@
}; };
users = { users = {
knownUsers = ["marley"]; knownUsers = [name];
users."marley" = { users."${name}" = {
# This is required for some reason. # This is required for some reason.
uid = 501; uid = 501;
@ -19,5 +21,9 @@
}; };
}; };
home-manager.users."${name}" = {
home.stateVersion = "24.05";
};
system.stateVersion = 5; system.stateVersion = 5;
} }

View file

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

View file

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

View file

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

View file

@ -1,62 +1,68 @@
{ {
pkgs,
inputs, inputs,
pkgs,
... ...
}: { }: {
nix = { imports = [
package = pkgs.lix; inputs.lix.nixosModules.default # this is universal, despite the 'nixos'
];
# Pin system <nixpkgs> to flake nixpkgs version. config = {
# i.e. for use in pkgs = import <nixpkgs> {}. nix = {
nixPath = ["nixpkgs=${inputs.nixpkgs}"]; package = pkgs.lix;
# Pin flake registry nixpkgs to flake nixpkgs version. # Pin system <nixpkgs> to flake nixpkgs version.
# i.e. for use in nix search nixpkgs. # i.e. for use in pkgs = import <nixpkgs> {}.
registry = { nixPath = ["nixpkgs=${inputs.nixpkgs}"];
nixpkgs.flake = 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 { config = lib.mkIf cfg.enable {
programs.fish = { programs.fish = {
enable = true; enable = true;
useBabelfish = 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 = [ imports = [
./home.nix ./home.nix
./nix.nix ./nix.nix
./stylix.nix
]; ];
} }

View file

@ -1,7 +1,15 @@
{config, ...}: let {
config,
inputs,
...
}: let
inherit (config.marleyos.my) name; inherit (config.marleyos.my) name;
in { in {
home-manager.users."${name}" = { imports = [inputs.home-manager.darwinModules.home-manager];
home.homeDirectory = "/Users/${name}";
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 = [ imports = [
inputs.agenix.darwinModules.default
../base ../base
./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 = { marleyos = {
profiles = { profiles = {
inherit (cfg.profiles) desktop server; inherit (cfg.profiles) desktop server;
hardware = {
inherit (cfg.profiles.hardware) nvidia;
};
}; };
my = { my = {

View file

@ -2,10 +2,13 @@
imports = [ imports = [
./boot.nix ./boot.nix
./drivers.nix ./drivers.nix
./fonts.nix
./home.nix ./home.nix
./i18n.nix ./i18n.nix
./mounts
./networking.nix ./networking.nix
./nix.nix ./nix.nix
./stylix.nix
./users.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; inherit (config.marleyos.my) name;
in { in {
home-manager.users."${name}" = { imports = [inputs.home-manager.nixosModules.home-manager];
home.homeDirectory = "/home/${name}"; 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 = [ imports = [
inputs.agenix.nixosModules.default
../base ../base
./base ./base
./hardware
./programs
]; ];
} }

View file

@ -1,11 +1,11 @@
{ {
pkgs,
config,
lib, lib,
config,
pkgs,
... ...
}: { }: {
config = lib.mkIf (!config.marleyos.profiles.server) { config = lib.mkIf (!config.marleyos.profiles.server) {
security.rtkit.enable = true; # Used for pulseaudio. security.rtkit.enable = true; # for pulseaudio
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
@ -15,8 +15,6 @@
alsa.enable = true; alsa.enable = true;
pulse.enable = true; pulse.enable = true;
}; };
printing.enable = true;
}; };
environment.systemPackages = [pkgs.pwvucontrol]; 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, config,
... ...
}: let }: let
cfg = config.marleyos.nvidia; cfg = config.marleyos.hardware.nvidia;
in { in {
options.marleyos.nvidia.enable = lib.mkEnableOption "nvidia"; options.marleyos.hardware.nvidia.enable = lib.mkEnableOption "nvidia";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# NVIDIA drivers are unfree. # NVIDIA drivers are unfree.

View file

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

View file

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

View file

@ -2,9 +2,5 @@
options.marleyos.profiles = { options.marleyos.profiles = {
desktop = lib.mkEnableOption "graphical desktop profile"; desktop = lib.mkEnableOption "graphical desktop profile";
server = lib.mkEnableOption "server 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;
};
}