mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
Merge branch 'server'
This commit is contained in:
commit
e9d1b10ae0
83 changed files with 802 additions and 152 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
result
|
|
||||||
35
README.md
35
README.md
|
|
@ -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:
|
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?) 🔍️
|
- [nixpkgs Options](https://search.nixos.org/options?) 🔍️
|
||||||
- [home-manager Options](https://mipmip.github.io/home-manager-option-search/) ☕️
|
- [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✨
|
Fork this repo and create your own NixOS config✨
|
||||||
|
|
||||||
Take inspiration💡, borrow ideas💭 and customize it to your 💖 content
|
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⚠️
|
⚠️ 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 ⚙️
|
## Requirements ⚙️
|
||||||
|
|
||||||
- Nix package manager ❄️
|
- [Nix package manager](https://www.nixos.org/)
|
||||||
- Nix 2.0 `flakes` enabled⚡️
|
- [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💥
|
Home-Manager Configurations:
|
||||||
|
- workstation
|
||||||
Add to your `nix.conf` or `configuration.nix`👇️
|
|
||||||
```nix
|
|
||||||
nix = {
|
|
||||||
package = pkgs.nixFlakes;
|
|
||||||
extraOptions = "experimental-features = nix-command flakes";
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
# Happy Nix Hacking! ❄️🔧💻️❄️
|
|
||||||
|
|
|
||||||
50
flake.nix
50
flake.nix
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||||
home-manager= {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
@ -25,23 +25,39 @@
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
|
nixosConfigurations = {
|
||||||
inherit system pkgs;
|
desktop = nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
inherit system pkgs;
|
||||||
./src/systems/desktop
|
modules = [
|
||||||
home-manager.nixosModules.home-manager
|
./src/system/machines/desktop
|
||||||
(import ./src/systems/desktop/home.nix)
|
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 {
|
homeConfigurations."work" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit system pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [ ./src/system/machines/workstation ];
|
||||||
./src/systems/wsl
|
|
||||||
nixos-wsl.nixosModules.wsl
|
|
||||||
(import ./src/systems/wsl/wsl.nix)
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
(import ./src/systems/wsl/home.nix)
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
imports = [ ./desktopEnvironments ];
|
|
||||||
}
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../user
|
../../../user/configs
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./system.nix
|
./system.nix
|
||||||
];
|
];
|
||||||
|
|
@ -14,12 +14,12 @@
|
||||||
# FStab
|
# FStab
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-uuid/af24c5b3-8a6e-4333-a61d-922a97928cae";
|
device = "/dev/disk/by-uuid/d4e0a913-9ba8-451e-9086-b6d5d483dd9f";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
"/home" = {
|
"/home" = {
|
||||||
device = "/dev/disk/by-uuid/1639ee20-28d6-4649-814d-ba981c138b35";
|
device = "/dev/disk/by-uuid/e1780967-0b87-46ff-8200-430d79d59e47";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -53,4 +53,3 @@
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5,8 +5,7 @@
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.users.${config.user.name} = {
|
home-manager.users.${config.user.name} = {
|
||||||
imports = [
|
imports = [
|
||||||
../../user
|
../../../user
|
||||||
../../modules
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
{ system.stateVersion = "22.11";
|
{ system.stateVersion = "23.11";
|
||||||
|
|
||||||
# Users
|
|
||||||
users.users = {
|
users.users = {
|
||||||
${config.user.name} = {
|
${config.user.name} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = config.user.groups;
|
extraGroups = config.user.groups
|
||||||
|
++ [ "video" "audio" "kvm" "libvirtd" "docker" ];
|
||||||
openssh.authorizedKeys.keys = config.user.sshKeys;
|
openssh.authorizedKeys.keys = config.user.sshKeys;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Nix
|
|
||||||
nix = {
|
nix = {
|
||||||
channel.enable = false;
|
channel.enable = false;
|
||||||
package = pkgs.nixFlakes;
|
package = pkgs.nixFlakes;
|
||||||
|
|
@ -27,7 +26,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Bootloader
|
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
timeout = null;
|
timeout = null;
|
||||||
grub = {
|
grub = {
|
||||||
|
|
@ -36,6 +34,7 @@
|
||||||
devices = [ "nodev" ];
|
devices = [ "nodev" ];
|
||||||
efiSupport = true;
|
efiSupport = true;
|
||||||
configurationLimit = 5;
|
configurationLimit = 5;
|
||||||
|
splashImage = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
efi = {
|
efi = {
|
||||||
|
|
@ -47,19 +46,16 @@
|
||||||
pavucontrol
|
pavucontrol
|
||||||
];
|
];
|
||||||
|
|
||||||
# DE
|
|
||||||
programs.sway = {
|
programs.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = null;
|
package = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Fonts
|
|
||||||
fonts.packages = with pkgs; [
|
fonts.packages = with pkgs; [
|
||||||
terminus_font
|
terminus_font
|
||||||
terminus-nerdfont
|
terminus-nerdfont
|
||||||
];
|
];
|
||||||
|
|
||||||
# Audio
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
audio.enable = true;
|
audio.enable = true;
|
||||||
|
|
@ -72,21 +68,11 @@
|
||||||
alsa.support32Bit = true;
|
alsa.support32Bit = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Sudo Options
|
|
||||||
security.sudo = {
|
security.sudo = {
|
||||||
wheelNeedsPassword = false;
|
wheelNeedsPassword = false;
|
||||||
execWheelOnly = true;
|
execWheelOnly = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# System Services
|
|
||||||
services = {
|
|
||||||
cron = {
|
|
||||||
enable = true;
|
|
||||||
systemCronJobs = [];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Locale
|
|
||||||
time = {
|
time = {
|
||||||
timeZone = "America/New_York";
|
timeZone = "America/New_York";
|
||||||
hardwareClockInLocalTime = true;
|
hardwareClockInLocalTime = true;
|
||||||
|
|
@ -109,7 +95,6 @@
|
||||||
useXkbConfig = true;
|
useXkbConfig = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Networking
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "socrates";
|
hostName = "socrates";
|
||||||
useDHCP = lib.mkDefault true;
|
useDHCP = lib.mkDefault true;
|
||||||
9
src/system/machines/server/default.nix
Normal file
9
src/system/machines/server/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../../user/configs
|
||||||
|
./hardware.nix
|
||||||
|
./system.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
32
src/system/machines/server/home.nix
Normal file
32
src/system/machines/server/home.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
106
src/system/machines/server/system.nix
Normal file
106
src/system/machines/server/system.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
7
src/system/machines/workstation/default.nix
Normal file
7
src/system/machines/workstation/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./home.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
50
src/system/machines/workstation/home.nix
Normal file
50
src/system/machines/workstation/home.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../user
|
../../../user/configs
|
||||||
./system.nix
|
./system.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
@ -5,13 +5,12 @@
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.users.${config.user.name} = {
|
home-manager.users.${config.user.name} = {
|
||||||
imports = [
|
imports = [
|
||||||
../../user
|
../../../user
|
||||||
../../modules
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
programs.bash.shellAliases = {
|
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";
|
home.stateVersion = "23.11";
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
options = "--delete-older-than 30d";
|
options = "--delete-older-than 30d";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Sudo Options
|
# Sudo Options
|
||||||
security.sudo = {
|
security.sudo = {
|
||||||
wheelNeedsPassword = false;
|
wheelNeedsPassword = false;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../user
|
../../../user
|
||||||
];
|
];
|
||||||
|
|
||||||
wsl = {
|
wsl = {
|
||||||
63
src/system/modules/bitcoin/default.nix
Normal file
63
src/system/modules/bitcoin/default.nix
Normal 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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./c-lightning-REST
|
||||||
|
];
|
||||||
|
}
|
||||||
7
src/system/modules/bitcoin/modules/default.nix
Normal file
7
src/system/modules/bitcoin/modules/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./core-lightning
|
||||||
|
./electrs
|
||||||
|
./sparrow-server
|
||||||
|
];
|
||||||
|
}
|
||||||
49
src/system/modules/bitcoin/modules/electrs/default.nix
Normal file
49
src/system/modules/bitcoin/modules/electrs/default.nix
Normal 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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
};
|
||||||
|
}
|
||||||
7
src/system/modules/default.nix
Normal file
7
src/system/modules/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./bitcoin
|
||||||
|
./nginx
|
||||||
|
./tor
|
||||||
|
];
|
||||||
|
}
|
||||||
21
src/system/modules/nginx/default.nix
Normal file
21
src/system/modules/nginx/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
5
src/system/modules/nginx/sites/default.nix
Normal file
5
src/system/modules/nginx/sites/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./mySite
|
||||||
|
];
|
||||||
|
}
|
||||||
30
src/system/modules/nginx/sites/mySite/default.nix
Normal file
30
src/system/modules/nginx/sites/mySite/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#};
|
||||||
|
};
|
||||||
|
}
|
||||||
23
src/system/modules/tor/default.nix
Normal file
23
src/system/modules/tor/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
5
src/system/modules/tor/modules/default.nix
Normal file
5
src/system/modules/tor/modules/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./relay
|
||||||
|
];
|
||||||
|
}
|
||||||
16
src/system/modules/tor/modules/relay.nix
Normal file
16
src/system/modules/tor/modules/relay.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
# TODO: nixify the server
|
|
||||||
63
src/user/configs/default.nix
Normal file
63
src/user/configs/default.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,64 +1,6 @@
|
||||||
{ lib, pkgs, ... }:
|
|
||||||
|
|
||||||
# Replace with your user configurations
|
|
||||||
{
|
{
|
||||||
options = {
|
imports = [
|
||||||
user = lib.mkOption {
|
./configs
|
||||||
type = lib.types.attrs;
|
./modules
|
||||||
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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,6 @@ function penpot() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
source ~/Documents/projects/ldv/ldv.sh
|
|
||||||
|
|
||||||
set -o vi
|
set -o vi
|
||||||
|
|
||||||
bind 'set completion-ignore-case on'
|
bind 'set completion-ignore-case on'
|
||||||
|
|
@ -9,7 +9,7 @@ check_ssh() {
|
||||||
add_icon() {
|
add_icon() {
|
||||||
local icon=$1
|
local icon=$1
|
||||||
if [[ ! $venv_icons =~ $icon ]]; then
|
if [[ ! $venv_icons =~ $icon ]]; then
|
||||||
venv_icons+="$icon"
|
venv_icons+="$icon "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
6
src/user/modules/gui/default.nix
Normal file
6
src/user/modules/gui/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./desktopEnvironments
|
||||||
|
./modules
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -17,13 +17,13 @@ in
|
||||||
HDMI-A-1 = {
|
HDMI-A-1 = {
|
||||||
resolution = "1920x1080";
|
resolution = "1920x1080";
|
||||||
position = "0,0";
|
position = "0,0";
|
||||||
bg = "/etc/nixos/src/modules/gui/wallpapers/mountains.jpg fill";
|
bg = "~/Pictures/wallpapers/${config.user.wallpaper} fill";
|
||||||
};
|
};
|
||||||
DP-1 = {
|
DP-1 = {
|
||||||
resolution = "1080x1920";
|
resolution = "1080x1920";
|
||||||
position = "1920,0";
|
position = "1920,0";
|
||||||
transform = "90";
|
transform = "90";
|
||||||
bg = "/etc/nixos/src/modules/gui/wallpapers/mountains.jpg fill";
|
bg = "~/Pictures/wallpapers/${config.user.wallpaper} fill";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
modifier = "Mod1";
|
modifier = "Mod1";
|
||||||
|
|
@ -6,7 +6,6 @@ let
|
||||||
|
|
||||||
in
|
in
|
||||||
{ options.modules.user.gui.sway = { enable = mkEnableOption "user.gui.sway"; };
|
{ options.modules.user.gui.sway = { enable = mkEnableOption "user.gui.sway"; };
|
||||||
imports = [ ../../modules ];
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; };
|
wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; };
|
||||||
programs.rofi = import ./config/rofi.nix { inherit pkgs config lib; };
|
programs.rofi = import ./config/rofi.nix { inherit pkgs config lib; };
|
||||||
|
|
@ -55,5 +54,10 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
home.file."Pictures/wallpapers" = {
|
||||||
|
source = ../../wallpapers;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -11,6 +11,7 @@ in
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
tor-browser
|
tor-browser
|
||||||
|
brave
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 609 KiB After Width: | Height: | Size: 609 KiB |
|
|
@ -11,10 +11,7 @@ in
|
||||||
nix-init
|
nix-init
|
||||||
nix-prefetch-git
|
nix-prefetch-git
|
||||||
|
|
||||||
glibc
|
|
||||||
gcc
|
gcc
|
||||||
|
|
||||||
docker
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
||||||
\| endif
|
\| endif
|
||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
Plug 'joshdick/onedark.vim'
|
Plug 'petobens/colorish'
|
||||||
Plug 'tpope/vim-surround'
|
Plug 'tpope/vim-surround'
|
||||||
Plug 'jiangmiao/auto-pairs'
|
Plug 'jiangmiao/auto-pairs'
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
|
|
@ -26,7 +26,8 @@ call plug#begin('~/.vim/plugged')
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
let mapleader = "\<Space>"
|
let mapleader = "\<Space>"
|
||||||
colorscheme onedark
|
set background=dark
|
||||||
|
colorscheme onedarkish
|
||||||
|
|
||||||
highlight CursorLine ctermbg=NONE guibg=NONE
|
highlight CursorLine ctermbg=NONE guibg=NONE
|
||||||
highlight CursorLineNr ctermfg=magenta guifg=magenta
|
highlight CursorLineNr ctermfg=magenta guifg=magenta
|
||||||
|
|
@ -7,6 +7,10 @@ let
|
||||||
in
|
in
|
||||||
{ options.modules.user.utils.vim = { enable = mkEnableOption "user.utils.vim"; };
|
{ options.modules.user.utils.vim = { enable = mkEnableOption "user.utils.vim"; };
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
vi = "${pkgs.vim}/bin/vim";
|
||||||
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
|
|
@ -16,8 +20,5 @@ in
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.bash.shellAliases = {
|
|
||||||
vi = "${pkgs.vim}/bin/vim";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
1
user.configs.nix
Symbolic link
1
user.configs.nix
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
src/user/configs/default.nix
|
||||||
Loading…
Add table
Add a link
Reference in a new issue