Compare commits
10 commits
30330d4e0e
...
050112880f
Author | SHA1 | Date | |
---|---|---|---|
050112880f | |||
196af0549c | |||
7201c083f0 | |||
928adc261f | |||
5b96e77e14 | |||
1562b2d179 | |||
ce706dd76a | |||
367db24109 | |||
41295cff75 | |||
f6b9287dfc |
23 changed files with 225 additions and 160 deletions
102
flake.nix
102
flake.nix
|
@ -2,107 +2,7 @@
|
||||||
description = "marleyOS";
|
description = "marleyOS";
|
||||||
|
|
||||||
outputs = inputs:
|
outputs = inputs:
|
||||||
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
inputs.flake-parts.lib.mkFlake {inherit inputs;} {imports = [./flake];};
|
||||||
imports = [inputs.easy-hosts.flakeModule];
|
|
||||||
|
|
||||||
systems = [
|
|
||||||
"x86_64-nixos"
|
|
||||||
"aarch64-darwin"
|
|
||||||
];
|
|
||||||
|
|
||||||
### Nixpkgs Config ###
|
|
||||||
perSystem = {system, ...}: {
|
|
||||||
_module.args.pkgs = import inputs.nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
overlays = with inputs; [
|
|
||||||
lix.overlays.default
|
|
||||||
nur.overlays.default
|
|
||||||
agenix.overlays.default
|
|
||||||
niri-flake.overlays.niri
|
|
||||||
|
|
||||||
(import ./overlays/ddclient.nix)
|
|
||||||
(import ./overlays/firefox-addons {
|
|
||||||
inherit (inputs.nixpkgs) lib;
|
|
||||||
inherit inputs;
|
|
||||||
})
|
|
||||||
(import ./overlays/jetbrains.nix {inherit inputs;})
|
|
||||||
(import ./overlays/maple-mono-NF.nix)
|
|
||||||
(import ./overlays/marleyvim.nix {inherit inputs;})
|
|
||||||
(import ./overlays/wezterm.nix {inherit inputs;})
|
|
||||||
|
|
||||||
# Custom packages
|
|
||||||
(import ./overlays/marleyos.nix)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
easyHosts = {
|
|
||||||
### Module Imports ###
|
|
||||||
shared.modules = with inputs; [
|
|
||||||
lix.nixosModules.default
|
|
||||||
agenix.nixosModules.default
|
|
||||||
|
|
||||||
{
|
|
||||||
home-manager.sharedModules = [
|
|
||||||
nixcord.homeModules.nixcord
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
perClass = class: {
|
|
||||||
modules = with inputs;
|
|
||||||
(nixpkgs.lib.optionals (class == "nixos") [
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
agenix.nixosModules.default
|
|
||||||
stylix.nixosModules.default
|
|
||||||
niri-flake.nixosModules.niri
|
|
||||||
])
|
|
||||||
++ (nixpkgs.lib.optionals (class == "darwin") [
|
|
||||||
home-manager.darwinModules.home-manager
|
|
||||||
agenix.darwinModules.default
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
|
|
||||||
hosts = {
|
|
||||||
### Desktop ###
|
|
||||||
nyx = {
|
|
||||||
arch = "x86_64";
|
|
||||||
class = "nixos";
|
|
||||||
};
|
|
||||||
|
|
||||||
### Macbook Air ###
|
|
||||||
mairley = {
|
|
||||||
arch = "aarch64";
|
|
||||||
class = "darwin";
|
|
||||||
nixpkgs = inputs.nixpkgs-darwin;
|
|
||||||
};
|
|
||||||
|
|
||||||
### Servers ###
|
|
||||||
|
|
||||||
marleycentre = {
|
|
||||||
arch = "x86_64";
|
|
||||||
class = "nixos";
|
|
||||||
};
|
|
||||||
|
|
||||||
marleynet = {
|
|
||||||
arch = "x86_64";
|
|
||||||
class = "nixos";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
flake = {
|
|
||||||
### Custom Library ###
|
|
||||||
lib.marleyos = {
|
|
||||||
module = ./lib/module.nix;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||||
|
|
38
flake/config.nix
Normal file
38
flake/config.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
|
||||||
|
### Nixpkgs Config ###
|
||||||
|
perSystem = {system, ...}: {
|
||||||
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO: Move these to custom modules
|
||||||
|
overlays = with inputs; [
|
||||||
|
lix.overlays.default
|
||||||
|
nur.overlays.default
|
||||||
|
agenix.overlays.default
|
||||||
|
niri-flake.overlays.niri
|
||||||
|
|
||||||
|
(import ./overlays/ddclient.nix)
|
||||||
|
(import ./overlays/firefox-addons {
|
||||||
|
inherit (inputs.nixpkgs) lib;
|
||||||
|
inherit inputs;
|
||||||
|
})
|
||||||
|
(import ./overlays/jetbrains.nix {inherit inputs;})
|
||||||
|
(import ./overlays/maple-mono-NF.nix)
|
||||||
|
(import ./overlays/marleyvim.nix {inherit inputs;})
|
||||||
|
(import ./overlays/wezterm.nix {inherit inputs;})
|
||||||
|
|
||||||
|
# Custom packages
|
||||||
|
(import ./overlays/marleyos.nix)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
7
flake/default.nix
Normal file
7
flake/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
|
||||||
|
../hosts
|
||||||
|
];
|
||||||
|
}
|
68
hosts/default.nix
Normal file
68
hosts/default.nix
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [inputs.easy-hosts.flakeModule];
|
||||||
|
|
||||||
|
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
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
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
|
||||||
|
# ]);
|
||||||
|
};
|
||||||
|
|
||||||
|
hosts = {
|
||||||
|
### Desktop ###
|
||||||
|
nyx = {
|
||||||
|
arch = "x86_64";
|
||||||
|
class = "nixos";
|
||||||
|
};
|
||||||
|
|
||||||
|
### Macbook Air ###
|
||||||
|
mairley = {
|
||||||
|
arch = "aarch64";
|
||||||
|
class = "darwin";
|
||||||
|
nixpkgs = inputs.nixpkgs-darwin;
|
||||||
|
};
|
||||||
|
|
||||||
|
### Servers ###
|
||||||
|
|
||||||
|
marleycentre = {
|
||||||
|
arch = "x86_64";
|
||||||
|
class = "nixos";
|
||||||
|
};
|
||||||
|
|
||||||
|
marleynet = {
|
||||||
|
arch = "x86_64";
|
||||||
|
class = "nixos";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
lib,
|
marleylib,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.marleyos) enabled;
|
inherit (marleylib.module) enabled;
|
||||||
in {
|
in {
|
||||||
networking = {
|
networking = {
|
||||||
computerName = "mairley";
|
computerName = "mairley";
|
||||||
|
@ -12,13 +12,15 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
marleyos = {
|
marleyos = {
|
||||||
appearance = {
|
profiles.desktop = enabled;
|
||||||
base = enabled;
|
|
||||||
};
|
# appearance = {
|
||||||
programs = {
|
# base = enabled;
|
||||||
fish = enabled;
|
# };
|
||||||
wezterm = enabled;
|
# programs = {
|
||||||
};
|
# fish = enabled;
|
||||||
|
# wezterm = enabled;
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{lib, ...}: let
|
{marleylib, ...}: let
|
||||||
inherit (lib.marleyos) enabled;
|
inherit (marleylib.module) enabled;
|
||||||
in {
|
in {
|
||||||
imports = [./hardware-configuration.nix];
|
imports = [./hardware-configuration.nix];
|
||||||
|
|
||||||
networking.hostName = "marleycentre";
|
networking.hostName = "marleycentre";
|
||||||
|
|
||||||
marleyos = {
|
marleyos = {
|
||||||
bundles.server = enabled;
|
profiles.server = enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users = {
|
users.users = {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{lib, ...}: let
|
{marleylib, ...}: let
|
||||||
inherit (lib.marleyos) enabled;
|
inherit (marleylib.module) enabled;
|
||||||
in {
|
in {
|
||||||
imports = [./hardware-configuration.nix];
|
imports = [./hardware-configuration.nix];
|
||||||
|
|
||||||
networking.hostName = "marleynet";
|
networking.hostName = "marleynet";
|
||||||
|
|
||||||
marleyos = {
|
marleyos = {
|
||||||
bundles.server = enabled;
|
profiles.server = enabled;
|
||||||
services.ddclient = enabled;
|
# services.ddclient = enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users = {
|
users.users = {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{lib, ...}: let
|
{marleylib, ...}: let
|
||||||
inherit (lib.marleyos) enabled;
|
inherit (marleylib.module) enabled;
|
||||||
in {
|
in {
|
||||||
imports = [./hardware-configuration.nix ./mounts.nix ./autorandr.nix];
|
imports = [./hardware-configuration.nix ./mounts.nix ./autorandr.nix];
|
||||||
|
|
||||||
|
@ -9,16 +9,12 @@ in {
|
||||||
networking.firewall.allowedTCPPorts = [8080];
|
networking.firewall.allowedTCPPorts = [8080];
|
||||||
|
|
||||||
marleyos = {
|
marleyos = {
|
||||||
hasNvidia = true;
|
profiles = {
|
||||||
|
desktop = enabled;
|
||||||
|
hardware.nvidia = enabled;
|
||||||
|
};
|
||||||
|
|
||||||
mounts.babeshare = enabled;
|
mounts.babeshare = enabled;
|
||||||
|
|
||||||
bundles.desktop = enabled;
|
|
||||||
|
|
||||||
wayland.niri = enabled;
|
|
||||||
services = {
|
|
||||||
ly = enabled;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
|
|
25
layout.txt
Normal file
25
layout.txt
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
modules/${class}/default.nix # imported by easy-hosts.perClass.modules
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
../base # common across all systems
|
||||||
|
./base # common across all ${class} systems
|
||||||
|
./shell # WM/DE
|
||||||
|
./programs
|
||||||
|
# default.nix - turns on/off depending on profile
|
||||||
|
./services
|
||||||
|
# default.nix - turns on/off depending on profile
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
modules/home/default.nix
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./shell # WM/DE
|
||||||
|
./programs
|
||||||
|
# default.nix - turns on/off depending on profile
|
||||||
|
# ${program}.nix - OS check here if needed
|
||||||
|
./services
|
||||||
|
# default.nix - turns on/off depending on profile
|
||||||
|
# ${service}.nix - OS check here if needed
|
||||||
|
];
|
3
lib/default.nix
Normal file
3
lib/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
module = import ./module.nix;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
enabled = {
|
enabled = {
|
||||||
## Quickly enable an option.
|
## Quickly enable an option.
|
||||||
##
|
##
|
||||||
|
|
9
modules/base/default.nix
Normal file
9
modules/base/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../options
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
../home
|
||||||
|
];
|
||||||
|
}
|
5
modules/darwin/default.nix
Normal file
5
modules/darwin/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../base
|
||||||
|
];
|
||||||
|
}
|
17
modules/nixos/base/boot.nix
Normal file
17
modules/nixos/base/boot.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
boot = {
|
||||||
|
kernelPackages =
|
||||||
|
lib.mkIf (!config.marleyos.profiles.server.enable)
|
||||||
|
pkgs.linuxPackages_xanmod;
|
||||||
|
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/nixos/base/default.nix
Normal file
6
modules/nixos/base/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./boot.nix
|
||||||
|
./drivers.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (!config.marleyos.isServer) {
|
config = lib.mkIf (!config.marleyos.profiles.server.enable) {
|
||||||
security.rtkit.enable = true; # Used for pulseaudio.
|
security.rtkit.enable = true; # Used for pulseaudio.
|
||||||
|
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
5
modules/nixos/default.nix
Normal file
5
modules/nixos/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../base
|
||||||
|
];
|
||||||
|
}
|
5
modules/options/default.nix
Normal file
5
modules/options/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./profiles.nix
|
||||||
|
];
|
||||||
|
}
|
10
modules/options/profiles.nix
Normal file
10
modules/options/profiles.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{lib, ...}: {
|
||||||
|
options.marleyos.profiles = {
|
||||||
|
desktop.enable = lib.mkEnableOption "graphical desktop profile";
|
||||||
|
server.enable = lib.mkEnableOption "server profile";
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
nvidia.enable = lib.mkEnableOption "Nvidia profile";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
boot.kernelPackages = lib.mkIf (!config.marleyos.isServer) pkgs.linuxPackages_xanmod;
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{lib, ...}: {
|
|
||||||
options.marleyos.hasNvidia = lib.mkOption {
|
|
||||||
type = with lib.types; bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether this machine has an NVIDIA GPU.";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{lib, ...}: {
|
|
||||||
options.marleyos.isDesktop = lib.mkOption {
|
|
||||||
type = with lib.types; bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether this machine is used as a graphical desktop.";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{lib, ...}: {
|
|
||||||
options.marleyos.isServer = lib.mkOption {
|
|
||||||
type = with lib.types; bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether this machine is a server.";
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue