Compare commits
10 commits
4211c16005
...
a9f699c4e1
Author | SHA1 | Date | |
---|---|---|---|
a9f699c4e1 | |||
1483f1f045 | |||
fc8534dc04 | |||
b30f617f44 | |||
2c4c938b1f | |||
fa75d5fa72 | |||
3d4a645cc4 | |||
7f1bcaa4b0 | |||
ab0e5117fa | |||
b3be8a6c27 |
27 changed files with 190 additions and 137 deletions
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
imports = [./hardware-configuration.nix];
|
imports = [./hardware-configuration.nix];
|
||||||
|
|
||||||
networking.hostName = "marleycentre";
|
networking.hostName = "marleycentre";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
imports = [./hardware-configuration.nix];
|
imports = [./hardware-configuration.nix];
|
||||||
|
|
||||||
networking.hostName = "marleynet";
|
networking.hostName = "marleynet";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
services.autorandr = {
|
services.autorandr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
systemd = {
|
systemd = {
|
||||||
mounts = [
|
mounts = [
|
||||||
{
|
{
|
||||||
|
|
19
layout.txt
19
layout.txt
|
@ -2,6 +2,7 @@ modules/${class}/default.nix # imported by easy-hosts.perClass.modules
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
../base # common across all systems
|
../base # common across all systems
|
||||||
|
|
||||||
./base # common across all ${class} systems
|
./base # common across all ${class} systems
|
||||||
./shell # WM/DE
|
./shell # WM/DE
|
||||||
./programs
|
./programs
|
||||||
|
@ -12,9 +13,25 @@ modules/${class}/default.nix # imported by easy-hosts.perClass.modules
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
modules/home/default.nix
|
modules/base/default.nix
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
../options # custom options used for deciding other config
|
||||||
|
|
||||||
|
{...} # modules w/i base
|
||||||
|
|
||||||
|
./home.nix # home-manager setup; imports modules/home
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
modules/home/default.nix # HOME MANAGER OPTIONS ONLY
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
../options
|
||||||
|
|
||||||
|
{...}
|
||||||
|
|
||||||
./shell # WM/DE
|
./shell # WM/DE
|
||||||
./programs
|
./programs
|
||||||
# default.nix - turns on/off depending on profile
|
# default.nix - turns on/off depending on profile
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
imports = [
|
imports = [
|
||||||
../options
|
../options
|
||||||
|
|
||||||
#
|
./nix.nix
|
||||||
|
|
||||||
../home
|
./home.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
22
modules/base/home.nix
Normal file
22
modules/base/home.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
let
|
||||||
|
my = {
|
||||||
|
name = "marley";
|
||||||
|
fullName = "Marley Rae";
|
||||||
|
username = "punkfairie";
|
||||||
|
email = "marley@punkfairie.net";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
marleyos.my = my;
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
useUserPackages = true;
|
||||||
|
useGlobalPackages = true;
|
||||||
|
backupFileExtension = "bak";
|
||||||
|
|
||||||
|
users."${my.name}" = {
|
||||||
|
home.username = my.name;
|
||||||
|
};
|
||||||
|
|
||||||
|
sharedModules = [../home];
|
||||||
|
};
|
||||||
|
}
|
62
modules/base/nix.nix
Normal file
62
modules/base/nix.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
nix = {
|
||||||
|
package = pkgs.lix;
|
||||||
|
|
||||||
|
# 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
6
modules/darwin/base/default.nix
Normal file
6
modules/darwin/base/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./home.nix
|
||||||
|
./nix.nix
|
||||||
|
];
|
||||||
|
}
|
7
modules/darwin/base/home.nix
Normal file
7
modules/darwin/base/home.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{config, ...}: let
|
||||||
|
inherit (config.marleyos.my) name;
|
||||||
|
in {
|
||||||
|
home-manager.users."${name}" = {
|
||||||
|
home.homeDirectory = "/Users/${name}";
|
||||||
|
};
|
||||||
|
}
|
9
modules/darwin/base/nix.nix
Normal file
9
modules/darwin/base/nix.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
settings = {
|
||||||
|
trusted-users = [
|
||||||
|
"@darwin"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../base
|
../base
|
||||||
|
./base
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
8
modules/home/default.nix
Normal file
8
modules/home/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../options
|
||||||
|
./option-inheritance.nix
|
||||||
|
|
||||||
|
./home-manager.nix
|
||||||
|
];
|
||||||
|
}
|
8
modules/home/home-manager.nix
Normal file
8
modules/home/home-manager.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
home.language.base = "en_US.UTF-8";
|
||||||
|
|
||||||
|
# Autostart wanted systemd services on Linux.
|
||||||
|
systemd.user.startServices = true;
|
||||||
|
}
|
17
modules/home/option-inheritance.nix
Normal file
17
modules/home/option-inheritance.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{osConfig, ...}: let
|
||||||
|
cfg = osConfig.marleyos;
|
||||||
|
in {
|
||||||
|
marleyos = {
|
||||||
|
profiles = {
|
||||||
|
inherit (cfg.profiles) desktop server;
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
inherit (cfg.profiles.hardware) nvidia;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
my = {
|
||||||
|
inherit (cfg.my) name fullName username email;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -2,6 +2,10 @@
|
||||||
imports = [
|
imports = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./drivers.nix
|
./drivers.nix
|
||||||
|
./home.nix
|
||||||
./i18n.nix
|
./i18n.nix
|
||||||
|
./networking.nix
|
||||||
|
./nix.nix
|
||||||
|
./users.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
7
modules/nixos/base/home.nix
Normal file
7
modules/nixos/base/home.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{config, ...}: let
|
||||||
|
inherit (config.marleyos.my) name;
|
||||||
|
in {
|
||||||
|
home-manager.users."${name}" = {
|
||||||
|
home.homeDirectory = "/home/${name}";
|
||||||
|
};
|
||||||
|
}
|
|
@ -11,6 +11,6 @@
|
||||||
allowedTCPPorts = [80 443];
|
allowedTCPPorts = [80 443];
|
||||||
};
|
};
|
||||||
|
|
||||||
wireless.enable = lib.mkIf config.marleyos.isServer false;
|
wireless.enable = lib.mkIf config.marleyos.profiles.server false;
|
||||||
};
|
};
|
||||||
}
|
}
|
9
modules/nixos/base/nix.nix
Normal file
9
modules/nixos/base/nix.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
settings = {
|
||||||
|
trusted-users = [
|
||||||
|
"@wheel"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -34,11 +34,9 @@ in {
|
||||||
++ (lib.optional config.networking.networkmanager.enable "networkmanager")
|
++ (lib.optional config.networking.networkmanager.enable "networkmanager")
|
||||||
++ (lib.optional config.virtualisation.docker.enable "docker");
|
++ (lib.optional config.virtualisation.docker.enable "docker");
|
||||||
hashedPassword =
|
hashedPassword =
|
||||||
if config.marleyos.isServer
|
if config.marleyos.profiles.server
|
||||||
then serverPass
|
then serverPass
|
||||||
else desktopPass;
|
else desktopPass;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.backupFileExtension = "bak";
|
|
||||||
}
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../base
|
../base
|
||||||
|
|
||||||
|
./base
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./my.nix
|
||||||
./profiles.nix
|
./profiles.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
options.marleyos.my = rec {
|
options.marleyos.my = rec {
|
||||||
name = lib.mkOption {
|
name = lib.mkOption {
|
||||||
type = with lib.types; str;
|
type = with lib.types; str;
|
||||||
default = config.snowfallorg.user.name or "marley";
|
default = "marley";
|
||||||
description = "Your username, for use as your login name.";
|
description = "Your username, for use as your login name.";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
config.nix = {
|
|
||||||
package = pkgs.lix;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.snowfall.system) is-linux;
|
|
||||||
in {
|
|
||||||
# Anything in this folder should not include an enable/disable option. This is
|
|
||||||
# the only folder that is always applied.
|
|
||||||
config = {
|
|
||||||
marleyos.my = {
|
|
||||||
name = "marley";
|
|
||||||
username = "punkfairie";
|
|
||||||
fullName = "Marley Rae";
|
|
||||||
email = "marley@punkfairie.net";
|
|
||||||
};
|
|
||||||
|
|
||||||
home.language.base = "en_US.UTF-8";
|
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
|
|
||||||
# Autostart wanted systemd services.
|
|
||||||
systemd.user.startServices = lib.mkIf (is-linux system) true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
config = {
|
|
||||||
nix = {
|
|
||||||
package = lib.mkForce pkgs.lix;
|
|
||||||
|
|
||||||
# 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 = {
|
|
||||||
trusted-users = [
|
|
||||||
"root"
|
|
||||||
"@wheel"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enable flakes.
|
|
||||||
experimental-features = [
|
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
|
|
||||||
# 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;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Garbage collection.
|
|
||||||
gc.automatic = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config.import = "${config.xdg.configHome}/nixpkgs/config.nix";
|
|
||||||
|
|
||||||
xdg.configFile."nixpkgs/config.nix".text =
|
|
||||||
# nix
|
|
||||||
''
|
|
||||||
{
|
|
||||||
allowUnfree = true;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
home.packages = let
|
|
||||||
nrepl =
|
|
||||||
pkgs.writeShellScriptBin "nrepl"
|
|
||||||
# sh
|
|
||||||
''
|
|
||||||
nix repl "${toString ./.}/repl.nix" "$@"
|
|
||||||
'';
|
|
||||||
in [
|
|
||||||
nrepl
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
nix = {
|
|
||||||
package = pkgs.lix;
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
experimental-features = ["nix-command" "flakes"];
|
|
||||||
|
|
||||||
trusted-users = [
|
|
||||||
"root"
|
|
||||||
"@wheel"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue