Merge branch 'server'

This commit is contained in:
Bryan Ramos 2024-05-10 00:23:01 -04:00
commit e9d1b10ae0
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
83 changed files with 802 additions and 152 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
result

View file

@ -1,6 +1,6 @@
# My NixOS Configurations ❄️👨‍💻
# My Nix Configurations ❄️‍💻
My modular NixOS🔥
My modular Nix configs🔥
If you need a list of available packages and options:
@ -8,35 +8,24 @@ If you need a list of available packages and options:
- [nixpkgs Options](https://search.nixos.org/options?) 🔍️
- [home-manager Options](https://mipmip.github.io/home-manager-option-search/) ☕️
## Get Inspired 🌟
Ready to go down the Nix 🐇🕳️❓️
Fork this repo and create your own NixOS config✨
Take inspiration💡, borrow ideas💭 and customize it to your 💖 content
⚠️ Be sure to tailor any settings related to my hardware and system to your own hardware⚠
👉Run `nixos-generate-config` if you need a new `hardware-configuration.nix`
## Requirements ⚙️
- Nix package manager ❄️
- Nix 2.0 `flakes` enabled⚡
- [Nix package manager](https://www.nixos.org/)
- [Nix 2.0 `flakes` enabled](https://nixos.wiki/wiki/Flakes#Enable_flakes_permanently_in_NixOS)
- [home-manager installed](https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-standalone)*optional*
Install by visiting [nixos.org](https://www.nixos.org/) or through your package manager🚀
# End-Points Exposed ❄️🔧💻️❄️
### Enabling Flakes ❄️
NixOS Configurations:
- desktop
- wsl
- server (wip)
Unleash Nix💥
Add to your `nix.conf` or `configuration.nix`👇️
```nix
nix = {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
};
```
# Happy Nix Hacking! ❄️🔧💻️❄️
Home-Manager Configurations:
- workstation

View file

@ -3,7 +3,7 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
home-manager= {
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -25,23 +25,39 @@
in
{
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./src/systems/desktop
home-manager.nixosModules.home-manager
(import ./src/systems/desktop/home.nix)
];
nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./src/system/machines/desktop
home-manager.nixosModules.home-manager
(import ./src/system/machines/desktop/home.nix)
];
};
wsl = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./src/system/machines/wsl
nixos-wsl.nixosModules.wsl
(import ./src/system/machines/wsl/wsl.nix)
home-manager.nixosModules.home-manager
(import ./src/system/machines/wsl/home.nix)
];
};
server = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./src/system/machines/server
home-manager.nixosModules.home-manager
(import ./src/system/machines/server/home.nix)
];
};
};
nixosConfigurations.windows = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./src/systems/wsl
nixos-wsl.nixosModules.wsl
(import ./src/systems/wsl/wsl.nix)
home-manager.nixosModules.home-manager
(import ./src/systems/wsl/home.nix)
];
homeConfigurations."work" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./src/system/machines/workstation ];
};
};
}

View file

@ -1,3 +0,0 @@
{
imports = [ ./desktopEnvironments ];
}

View file

@ -2,7 +2,7 @@
{
imports = [
../../user
../../../user/configs
./hardware.nix
./system.nix
];

View file

@ -14,12 +14,12 @@
# FStab
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/af24c5b3-8a6e-4333-a61d-922a97928cae";
device = "/dev/disk/by-uuid/d4e0a913-9ba8-451e-9086-b6d5d483dd9f";
fsType = "ext4";
};
"/home" = {
device = "/dev/disk/by-uuid/1639ee20-28d6-4649-814d-ba981c138b35";
device = "/dev/disk/by-uuid/e1780967-0b87-46ff-8200-430d79d59e47";
fsType = "ext4";
};
@ -53,4 +53,3 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -5,8 +5,7 @@
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [
../../user
../../modules
../../../user
];
programs.home-manager.enable = true;

View file

@ -1,17 +1,16 @@
{ pkgs, lib, config, ... }:
{ system.stateVersion = "22.11";
{ system.stateVersion = "23.11";
# Users
users.users = {
${config.user.name} = {
isNormalUser = true;
extraGroups = config.user.groups;
extraGroups = config.user.groups
++ [ "video" "audio" "kvm" "libvirtd" "docker" ];
openssh.authorizedKeys.keys = config.user.sshKeys;
};
};
# Nix
nix = {
channel.enable = false;
package = pkgs.nixFlakes;
@ -27,7 +26,6 @@
};
};
# Bootloader
boot.loader = {
timeout = null;
grub = {
@ -36,6 +34,7 @@
devices = [ "nodev" ];
efiSupport = true;
configurationLimit = 5;
splashImage = null;
};
efi = {
@ -47,19 +46,16 @@
pavucontrol
];
# DE
programs.sway = {
enable = true;
package = null;
};
# Fonts
fonts.packages = with pkgs; [
terminus_font
terminus-nerdfont
];
# Audio
services.pipewire = {
enable = true;
audio.enable = true;
@ -72,21 +68,11 @@
alsa.support32Bit = true;
};
# Sudo Options
security.sudo = {
wheelNeedsPassword = false;
execWheelOnly = true;
};
# System Services
services = {
cron = {
enable = true;
systemCronJobs = [];
};
};
# Locale
time = {
timeZone = "America/New_York";
hardwareClockInLocalTime = true;
@ -109,7 +95,6 @@
useXkbConfig = true;
};
# Networking
networking = {
hostName = "socrates";
useDHCP = lib.mkDefault true;

View file

@ -0,0 +1,9 @@
{ ... }:
{
imports = [
../../../user/configs
./hardware.nix
./system.nix
];
}

View file

@ -0,0 +1,32 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [
../../../user
];
programs.home-manager.enable = true;
programs.bash.shellAliases = {
nixup = "sudo nixos-rebuild switch --flake /etc/nixos/.#server";
};
home.stateVersion = "23.11";
home.username = "${config.user.name}";
home.homeDirectory = "/home/${config.user.name}";
modules = {
user = {
bash.enable = true;
git.enable = true;
gui.enable = false;
gpg.enable = true;
utils.enable = true;
vim.enable = true;
};
};
};
}

View file

@ -0,0 +1,106 @@
{ pkgs, lib, config, ... }:
{ system.stateVersion = "23.11";
imports = [
../modules
];
modules = {
bitcoin = {
enable = true;
clightning = true;
electrs = true;
sparrow-server = true;
};
};
users.users = {
${config.user.name} = {
isNormalUser = true;
extraGroups = config.user.groups;
openssh.authorizedKeys.keys = config.user.sshKeys;
};
};
nix = {
channel.enable = false;
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
settings = {
auto-optimise-store = true;
trusted-users = [ "${config.user.name}" ];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
boot.loader = {
timeout = null;
grub = {
enable = true;
useOSProber = true;
devices = [ "nodev" ];
efiSupport = true;
configurationLimit = 5;
};
efi = {
canTouchEfiVariables = true;
};
};
fonts.packages = with pkgs; [
terminus_font
terminus-nerdfont
];
security.sudo = {
wheelNeedsPassword = false;
execWheelOnly = true;
};
time = {
timeZone = "America/New_York";
hardwareClockInLocalTime = true;
};
services.timesyncd = {
enable = true;
servers = [
"0.pool.ntp.org"
"1.pool.ntp.org"
"2.pool.ntp.org"
"3.pool.ntp.org"
];
};
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true;
};
networking = {
hostName = "archimedes";
useDHCP = lib.mkDefault true;
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [ 22 80 443 ];
};
};
services.openssh = {
enable = true;
startWhenNeeded = true;
settings = {
X11Forwarding = false;
PasswordAuthentication = false;
};
};
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./home.nix
];
}

View file

@ -0,0 +1,50 @@
{ config, pkgs, ... }:
{
imports = [ ../../../user ];
home = {
stateVersion = "23.11";
username = "${config.user.name}";
homeDirectory = "/home/${config.user.name}";
file.".config/home-manager" = {
source = ../../../..;
recursive = true;
};
};
programs.home-manager.enable = true;
programs.bash.shellAliases = {
#nixup = "home-manager switch --flake";
};
nix = {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
settings = {
auto-optimise-store = true;
trusted-users = [ "${config.user.name}" ];
};
};
modules = {
user = {
bash.enable = true;
git.enable = true;
gpg.enable = true;
security.enable = false;
gui = {
alacritty.enable = true;
browsers.enable = true;
neovim.enable = true;
};
utils = {
enable = true;
dev.enable = true;
email.enable = true;
irc.enable = true;
vim.enable = true;
};
};
};
}

View file

@ -2,7 +2,7 @@
{
imports = [
../../user
../../../user/configs
./system.nix
];
}

View file

@ -5,13 +5,12 @@
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [
../../user
../../modules
../../../user
];
programs.home-manager.enable = true;
programs.bash.shellAliases = {
nixup = "sudo nixos-rebuild switch --flake /etc/nixos/.#windows";
nixup = "sudo nixos-rebuild switch --flake /etc/nixos/.#wsl";
};
home.stateVersion = "23.11";

View file

@ -27,6 +27,7 @@
options = "--delete-older-than 30d";
};
};
# Sudo Options
security.sudo = {
wheelNeedsPassword = false;

View file

@ -2,7 +2,7 @@
{
imports = [
../../user
../../../user
];
wsl = {

View file

@ -0,0 +1,63 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.system.bitcoin;
in
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
imports = [ ./modules ];
config = mkIf cfg.enable {
programs.bash.shellAliases = {
btc = "bitcoin-cli";
};
users = {
users = {
"bitcoind" = {
description = "bitcoind system user";
isSystemUser = true;
group = "bitcoin";
home = /var/lib/bitcoind;
createHome = true;
};
};
groups = {
"bitcoin" = {
members = [ "clightning" "electrs" ];
};
};
};
services.bitcoind = {
"bitcoind" = {
enable = true;
testnet = false;
user = "bitcoind";
group = "bitcoin";
configFile = /var/lib/bitcoind/bitcoin.conf;
rpc = {
port = 8332;
};
extraConfig = ''
server=1
mempoolfullrbf=1
v2transport=1
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
proxy=127.0.0.1:9050
listen=1
listenonion=1
torcontrol=127.0.0.1:9051
torenablecircuit=1
'';
};
};
};
}

View file

@ -0,0 +1,73 @@
{ lib, pkgs, config, ... }:
#TODO: c-lightning config file
with lib;
let cfg = config.modules.system.bitcoin.core-lightning;
in
{ options.modules.system.bitcoin.core-lightning = { enable = mkEnableOption "system.bitcoin.core-lightning"; };
config = mkIf cfg.enable {
imports = [ ./modules ];
programs.bash.shellAliases = {
cln = "lightningd";
};
environment.systemPackages = with pkgs; [
clightning
];
users = {
users = {
"c-lightning" = {
description = "core-lightning system user";
isSystemUser = true;
group = "bitcoin";
home = /var/lib/c-lightning;
createHome = true;
};
};
};
systemd.services.lightningd = {
Unit = {
Description = "Core Lightning daemon";
Requires = [ "bitcoind.service" ];
After = [ "bitcoind.service" "network-online.target" ];
Wants = [ "network-online.target" ];
};
Service = {
ExecStartPre =
let
lightningConf = ''
''; #put lightning conf here
in
"${pkgs.writeShellScript "prepare-clightning-config" ''
mkdir -p /var/lib/c-lightning/.lightning
chown -R c-lightning:bitcoin /var/lib/c-lightning
echo "${lightningConf}" > /var/lib/c-lightning/.lightning/config
chmod 600 /var/lib/c-lightning/.lightning/config
''}";
ExecStart = "${pkgs.clightning}/bin/lightningd --conf=/var/lib/c-lightning/.lightning/config";
RuntimeDirectory = "lightningd";
User = "c-lightning";
Group = "bitcoin";
Type = "forking";
PIDFile = "/run/lightningd/lightningd.pid";
Restart = "on-failute";
PrivateTmp = true;
ProtectSystem = "full";
NoNewPrivileges = true;
PrivateDevies = true;
MemoryDenyWriteAccess = false;
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
};
}

View file

@ -0,0 +1,18 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.modules.system.bitcoin.core-lightning.REST;
cln = config.modules.system.bitcoin.core-lightning;
c-lightning-REST = import ./derivation.nix { inherit pkgs; };
in
{ options.modules.system.bitcoin.core-lightning.REST = {
enable = mkEnableOption "system.bitcoin.core-lightning.REST";
};
config = mkIf (cfg.enable && cln.enable) {
environment.systemPackages = with pkgs; [
c-lightning-REST
];
};
}

View file

@ -0,0 +1,28 @@
{ pkgs, ... }:
with pkgs;
stdenv.mkDerivation rec {
pname = "c-lightning-REST";
version = "0.10.7";
src = fetchurl {
url = "https://github.com/Ride-The-Lightning/c-lightning-REST/archive/refs/tags/v${version}.tar.gz";
sha256 = "1swg53vbacsrsgy79lni07dy2h44b0yf2kad7j4fv17az4gwnxk7";
};
buildInputs = with pkgs; [
nodejs
];
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
meta = {
description = "c-lighting REST API";
homepage = "https://github.com/Ride-The-Lightning/c-lightning-REST";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux;
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./c-lightning-REST
];
}

View file

@ -0,0 +1,7 @@
{
imports = [
./core-lightning
./electrs
./sparrow-server
];
}

View file

@ -0,0 +1,49 @@
{ lib, pkgs, config, ... }:
#TODO: electrs configuration file
with lib;
let cfg = config.modules.bitcoin.electrs;
in
{ options.modules.bitcoin.electrs = { enable = mkEnableOption "bitcoin.electrs"; };
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
electrs
];
users = {
users = {
"electrs" = {
description = "electrs system user";
isSystemUser = true;
group = "bitcoin";
home = /var/lib/electrs;
createHome = true;
};
};
};
systemd.services.electrs = {
Unit = {
Description = "Electrs Bitcoin Indexer";
After = [ "network.target" "bitcoind.service" ];
Requires = [ "bitcoind.service" ];
};
Service = {
ExecStartPre = "/usr/bin/sleep 10";
ExecStart = "${pkgs.electrs}/bin/electrs";
User = "electrs";
Group = "bitcoin";
Type = "simple";
KillMode = "process";
TimeoutSec = 60;
Restart = "always";
RestartSec = 60;
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
};
}

View file

@ -0,0 +1,14 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.modules.system.bitcoin.sparrow-server;
sparrow-server = import ./derivation.nix { inherit pkgs; };
in
{ options.modules.system.bitcoin.sparrow-server = { enable = mkEnableOption "system.bitcoin.sparrow-server"; };
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
sparrow-server
];
};
}

View file

@ -0,0 +1,24 @@
{ pkgs, ... }:
with pkgs;
stdenv.mkDerivation rec {
pname = "sparrow-server";
version = "1.8.2";
src = fetchurl {
url = "https://github.com/sparrowwallet/sparrow/releases/download/${version}/sparrow-server-${version}-x86_64.tar.gz";
sha256 = "16hyrf8j7mv3m1ry7r2k3w70yxbf6smgcm5d35xy2hjqfmahv65m";
};
installPhase = ''
mkdir -p $out/bin
cp -r * $out/bin
'';
meta = {
description = "Sparrow Server";
homepage = "https://sparrowwallet.com/";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux;
};
}

View file

@ -0,0 +1,7 @@
{
imports = [
./bitcoin
./nginx
./tor
];
}

View file

@ -0,0 +1,21 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.system.nginx;
in
{ options.modules.system.nginx = { enable = mkEnableOption "system.nginx"; };
config = mkIf cfg.enable {
imports = [ ./sites ];
security.acme = {
defaults = {
email = config.user.email;
};
};
services.nginx = {
enable = true;
package = pkgs.nginxMainLine;
};
};
}

View file

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

View file

@ -0,0 +1,30 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.nginx.mySite;
nginxCfg = config.modules.system.nginx;
in
{ options.modules.system.nginx.mySite = { enable = mkEnableOption "system.nginx.mySite"; };
config = mkIf (cfg.enable && nginxCfg) {
security.acme = {
certs = {
"*.ramos.codes" = {
#TODO: configure ACME certs
};
};
};
services.nginx = {
#TODO: check if configure as vhost or stream
virtualHosts = {
"*.ramos.codes" = {
addSSL = true;
onlySSL = true;
forceSSL = true;
acmeRoot = null;
};
};
};
};
}

View file

@ -0,0 +1,31 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.nginx.mySite.btc;
mySiteCfg = config.modules.system.nginx.mySite;
btcCfg = config.modules.system.bitcoin;
in
{ options.modules.system.nginx.mySite.btc = { enable = mkEnableOption "system.nginx.mySite.btc"; };
config = mkIf (cfg.enable && mySiteCfg && btcCfg) {
#security.acme = {
# certs = {
# "btc.ramos.codes" = {
# #TODO: configure ACME certs
# };
# };
#};
#services.nginx = {
# #TODO: check if configure as vhost or stream
# virtualHosts = {
# "btc.ramos.codes" = {
# addSSL = true;
# onlySSL = true;
# forceSSL = true;
# acmeRoot = null;
# };
# };
#};
};
}

View file

@ -0,0 +1,30 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.nginx.mySite.git;
mySiteCfg = config.modules.system.nginx.mySite;
in
{ options.modules.system.nginx.mySite.git = { enable = mkEnableOption "system.nginx.mySite.git"; };
config = mkIf (cfg.enable && mySiteCfg) {
#security.acme = {
# certs = {
# "ramos.codes" = {
# #TODO: configure ACME certs
# };
# };
#};
#services.nginx = {
# #TODO: check if configure as vhost or stream
# streamConfig = services.nginx.streamConfig ++ {
# "*.ramos.codes" = {
# addSSL = true;
# onlySSL = true;
# forceSSL = true;
# acmeRoot = null;
# };
# };
#};
};
}

View file

@ -0,0 +1,23 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.tor;
in
{ options.modules.system.tor = { enable = mkEnableOption "system.tor"; };
config = mkIf cfg.enable {
imports = [ ./modules ];
services.tor = {
enable = true;
client = {
enable = lib.mkDefault true;
dns.enable = mkIf services.tor.client.enable true;
};
relay.enable = lib.mkDefault false;
enableGeoIP = false;
DoSConnectionEnabled = true;
DoSCircuitCreationEnabled = true;
};
};
}

View file

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

View file

@ -0,0 +1,16 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.tor.relay;
torCfg = config.modules.system.tor;
in
{ options.modules.system.tor.relay = { enable = mkEnableOption "system.tor.relay"; };
config = mkIf (cfg.enable && torCfg.enable) {
services.tor = {
client.enable = false;
relay.enable = true;
};
};
}

View file

@ -1 +0,0 @@
# TODO: nixify the server

View file

@ -0,0 +1,63 @@
{ lib, pkgs, ... }:
let
userConfigs = rec {
name = "bryan";
email = "bryan@ramos.codes";
shell = pkgs.bash;
# This will pull an image from your ~Pictures/wallpapers directory
wallpaper = "mountains.jpg";
groups = [ "wheel" "networkmanager" "home-manager" "input" ];
sshKeys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDl4895aB9P5p/lp8Hq5rHun4clvhyTSHFi3U2d6OOBoW5Fm+VcQnW/xbjmCBsXk5BdiowsBxQhwnzdfz/KJL7J5RobomUEaVRwb9UwT88eJveLp14BG8j2J3SjfyhrCX+4jkPx0bPQk1HGcuYY+tPEXf1q/ps88Dhu0CARBIzYQOTYY6b1qWzxpDoFZGHjKG8g5iY6FIu65yKKvvVy1f8IgZ3l3IpwBWVamxgkTcYY0QYSrmzo1n7TXxwrWbvenAqBsQ0cBPs+gVa3uIr+1TJl0Az5SElBVGu3LvUdlk58trtPUj6TQR3YUkg7Vjll7WHOdqhux5ZQNhjkOsHerf0Tw86e6cEzgeTuIbQHIb0LcsUunwKcuh2+au7RO599cvHn0+xZE5MZBxloDDaJ3JsiliM8kyPP/U3ERj03cWLW7BqbT+sfjAOl21RCzk0iQxk1wt/8VmtCr9Adv7IyrtaYvf/bwRP+g+9ldmzKGt8Mdb605uVzZ70H/LLm17f40Te+QHaex5by/6p6cuwEEZtgIg53Wpglu0rA6UxrBfQEHKl/Jt3FLeE0mnEyYkkR2MnHNtyWRIXtuqYZMAm2Ub1pFHH7jQV1gGiDVTw6a2eIwK21a/hXtRjFUpFd1nB1n+KNfJBE4zT3wm3Ud7mKw/6rWnoRyhYZvGXkFdp+iEs49Q=="
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK2ROz7EVvE+nzF5k9EYZ2v3JhBzk058uh3QJTzcG4t70fkZgh9y56AOx26eXlKQWuuV05e8EkWRuVI8gfA2ROI="
];
gitConfig = {
userName = "Bryan Ramos";
userEmail = email;
signing = {
key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D";
signByDefault = true;
};
extraConfig = {
init = { defaultBranch = "master"; };
mergetool = {
lazygit = {
cmd = "lazygit";
trustExitCode = true;
};
};
merge = { tool = "lazygit"; };
safe = { directory = "/etc/nixos"; };
};
ignores = [
"node_modules"
".direnv"
"dist-newstyle"
".nuxt/"
".output/"
"dist"
];
};
pgpKey = {
text = import ./pgpKey.nix;
trust = 5;
};
};
in
{
options = {
user = lib.mkOption {
type = lib.types.attrs;
default = userConfigs;
description = "User Configurations";
};
};
}

View file

@ -1,64 +1,6 @@
{ lib, pkgs, ... }:
# Replace with your user configurations
{
options = {
user = lib.mkOption {
type = lib.types.attrs;
default = {
name = "bryan";
shell = pkgs.bash;
groups = [
"wheel" "networkmanager" "home-manager"
"input" "video" "audio"
"kvm" "libvirtd" "docker"
];
sshKeys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDl4895aB9P5p/lp8Hq5rHun4clvhyTSHFi3U2d6OOBoW5Fm+VcQnW/xbjmCBsXk5BdiowsBxQhwnzdfz/KJL7J5RobomUEaVRwb9UwT88eJveLp14BG8j2J3SjfyhrCX+4jkPx0bPQk1HGcuYY+tPEXf1q/ps88Dhu0CARBIzYQOTYY6b1qWzxpDoFZGHjKG8g5iY6FIu65yKKvvVy1f8IgZ3l3IpwBWVamxgkTcYY0QYSrmzo1n7TXxwrWbvenAqBsQ0cBPs+gVa3uIr+1TJl0Az5SElBVGu3LvUdlk58trtPUj6TQR3YUkg7Vjll7WHOdqhux5ZQNhjkOsHerf0Tw86e6cEzgeTuIbQHIb0LcsUunwKcuh2+au7RO599cvHn0+xZE5MZBxloDDaJ3JsiliM8kyPP/U3ERj03cWLW7BqbT+sfjAOl21RCzk0iQxk1wt/8VmtCr9Adv7IyrtaYvf/bwRP+g+9ldmzKGt8Mdb605uVzZ70H/LLm17f40Te+QHaex5by/6p6cuwEEZtgIg53Wpglu0rA6UxrBfQEHKl/Jt3FLeE0mnEyYkkR2MnHNtyWRIXtuqYZMAm2Ub1pFHH7jQV1gGiDVTw6a2eIwK21a/hXtRjFUpFd1nB1n+KNfJBE4zT3wm3Ud7mKw/6rWnoRyhYZvGXkFdp+iEs49Q=="
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK2ROz7EVvE+nzF5k9EYZ2v3JhBzk058uh3QJTzcG4t70fkZgh9y56AOx26eXlKQWuuV05e8EkWRuVI8gfA2ROI="
];
gitConfig= {
userName = "Bryan Ramos";
userEmail = "bryan@ramos.codes";
signing = {
key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D";
signByDefault = true;
};
extraConfig = {
init = { defaultBranch = "master"; };
mergetool = {
lazygit = {
cmd = "lazygit";
trustExitCode = true;
};
};
merge = {
tool = "lazygit";
};
safe = {
directory = "/etc/nixos";
};
};
ignores = [
"node_modules"
".direnv"
"dist-newstyle"
".nuxt/"
".output/"
"dist"
];
};
pgpKey = {
text = import ./pgpKey.nix;
trust = 5;
};
};
};
};
imports = [
./configs
./modules
];
}

View file

@ -54,8 +54,6 @@ function penpot() {
esac
}
source ~/Documents/projects/ldv/ldv.sh
set -o vi
bind 'set completion-ignore-case on'

View file

@ -9,7 +9,7 @@ check_ssh() {
add_icon() {
local icon=$1
if [[ ! $venv_icons =~ $icon ]]; then
venv_icons+="$icon"
venv_icons+="$icon "
fi
}

View file

@ -0,0 +1,6 @@
{
imports = [
./desktopEnvironments
./modules
];
}

View file

@ -17,13 +17,13 @@ in
HDMI-A-1 = {
resolution = "1920x1080";
position = "0,0";
bg = "/etc/nixos/src/modules/gui/wallpapers/mountains.jpg fill";
bg = "~/Pictures/wallpapers/${config.user.wallpaper} fill";
};
DP-1 = {
resolution = "1080x1920";
position = "1920,0";
transform = "90";
bg = "/etc/nixos/src/modules/gui/wallpapers/mountains.jpg fill";
bg = "~/Pictures/wallpapers/${config.user.wallpaper} fill";
};
};
modifier = "Mod1";

View file

@ -6,7 +6,6 @@ let
in
{ options.modules.user.gui.sway = { enable = mkEnableOption "user.gui.sway"; };
imports = [ ../../modules ];
config = mkIf cfg.enable {
wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; };
programs.rofi = import ./config/rofi.nix { inherit pkgs config lib; };
@ -55,5 +54,10 @@ in
};
fonts.fontconfig.enable = true;
home.file."Pictures/wallpapers" = {
source = ../../wallpapers;
recursive = true;
};
};
}

View file

@ -11,6 +11,7 @@ in
home.packages = with pkgs; [
tor-browser
brave
];
};
}

View file

Before

Width:  |  Height:  |  Size: 609 KiB

After

Width:  |  Height:  |  Size: 609 KiB

Before After
Before After

View file

@ -11,10 +11,7 @@ in
nix-init
nix-prefetch-git
glibc
gcc
docker
];
};
}

View file

@ -13,7 +13,7 @@ autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| endif
call plug#begin('~/.vim/plugged')
Plug 'joshdick/onedark.vim'
Plug 'petobens/colorish'
Plug 'tpope/vim-surround'
Plug 'jiangmiao/auto-pairs'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
@ -26,7 +26,8 @@ call plug#begin('~/.vim/plugged')
call plug#end()
let mapleader = "\<Space>"
colorscheme onedark
set background=dark
colorscheme onedarkish
highlight CursorLine ctermbg=NONE guibg=NONE
highlight CursorLineNr ctermfg=magenta guifg=magenta

View file

@ -7,6 +7,10 @@ let
in
{ options.modules.user.utils.vim = { enable = mkEnableOption "user.utils.vim"; };
config = mkIf cfg.enable {
programs.bash.shellAliases = {
vi = "${pkgs.vim}/bin/vim";
};
home = {
packages = with pkgs; [
vim
@ -16,8 +20,5 @@ in
recursive = true;
};
};
programs.bash.shellAliases = {
vi = "${pkgs.vim}/bin/vim";
};
};
}

1
user.configs.nix Symbolic link
View file

@ -0,0 +1 @@
src/user/configs/default.nix