Skip to content

Commit

Permalink
i will ammend it later
Browse files Browse the repository at this point in the history
  • Loading branch information
sioodmy committed Jul 13, 2024
1 parent 45404b0 commit fc68244
Show file tree
Hide file tree
Showing 15 changed files with 1,138 additions and 247 deletions.
1,161 changes: 942 additions & 219 deletions flake.lock

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@
};
};

nix-index-db = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
homix = {
url = "github:sioodmy/homix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};

flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
Expand Down
5 changes: 0 additions & 5 deletions home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
{
config.home.stateVersion = "22.05";
imports = [
inputs.nix-index-db.hmModules.nix-index
# inputs.niri.homeModules.niri
inputs.schizofox.homeManagerModule
inputs.impermanence.nixosModules.home-manager.impermanence
./packages.nix
./impermanence.nix

./scripts
./misc
];
Expand Down
6 changes: 3 additions & 3 deletions home/impermanence.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ in {
"vids"
"other"
]
++ forEach ["syncthing" "Caprine" "VencordDesktop" "obs-studio" "Signal" "niri" "BraveSoftware" "nicotine" "ags"] (
++ forEach ["syncthing" "Caprine" "VencordDesktop" "obs-studio" "Signal" "niri" "BraveSoftware" "nicotine" "ags" "nushell" "emacs"] (
x: ".config/${x}"
)
++ forEach ["tealdeer" "keepassxc" "nix" "starship" "nix-index" "mozilla" "go-build" "BraveSoftware"] (
++ forEach ["tealdeer" "keepassxc" "nix" "starship" "nix-index" "mozilla" "go-build" "BraveSoftware" "zsh" "nvim"] (
x: ".cache/${x}"
)
++ forEach ["direnv" "TelegramDesktop" "PrismLauncher" "keyrings" "nicotine"] (x: ".local/share/${x}")
++ forEach ["direnv" "TelegramDesktop" "PrismLauncher" "keyrings" "nicotine" "zoxide"] (x: ".local/share/${x}")
++ [".ssh" ".keepass" ".mozilla" ".thunderbird"];
};
}
73 changes: 73 additions & 0 deletions home/misc/#git.nix#
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{pkgs, ...}: {
home.packages = with pkgs; [zsh-forgit gitflow];
programs.git = {
enable = true;
userName = "sioodmy";
userEmail = "hello@sioodmy.dev";
signing = {
key = "056CFD15A9F99B0E";
signByDefault = false;
};
ignores = [
".cache/"
".DS_Store"
".idea/"
"*.swp"
"*.elc"
"auto-save-list"
".direnv/"
"node_modules"
"result"
"result-*"
];
extraConfig = {
init = {defaultBranch = "main";};
delta = {
options.map-styles = "bold purple => syntax #ca9ee6, bold cyan => syntax #8caaee";
line-numbers = true;
};
branch.autosetupmerge = "true";
push.default = "current";
merge.stat = "true";
core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
repack.usedeltabaseoffset = "true";
pull.ff = "only";
rebase = {
autoSquash = true;
autoStash = true;
};
rerere = {
autoupdate = true;
enabled = true;
};
};
lfs.enable = true;
delta.enable = true;
aliases = {
essa = "push --force";
co = "checkout";
fuck = "commit --amend -m";
c = "commit -m";
ca = "commit -am";
forgor = "commit --amend --no-edit";
graph = "log --all --decorate --graph --oneline";
oops = "checkout --";
l = "log";
r = "rebase";
s = "status --short";
ss = "status";
d = "diff";
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)";
st = "status";
br = "branch";
df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}";
hist = ''
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all'';
llog = ''
log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative'';
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
};
};
}
5 changes: 1 addition & 4 deletions home/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
home.packages = with pkgs; [
inputs.ags.packages.${pkgs.system}.default

cider
#ags
overskride
dart-sass

libreoffice-fresh
ytmdl
thunderbird
nicotine-plus
fuzzel
gnome.gnome-calculator
brave
inkscape
Expand All @@ -25,10 +24,8 @@
calcurse
pulseaudio
signal-desktop
transmission-gtk
gimp
wireshark
keepassxc
dconf
];
}
25 changes: 14 additions & 11 deletions hosts/calypso/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
inherit (lib) mkDefault;
in {
imports = [./hardware-configuration.nix];
environment.systemPackages = with pkgs; [
acpi
powertop
mic-light-on
mic-light-off
];
environment.systemPackages =
(with pkgs; [
acpi
powertop
])
++ [
mic-light-on
mic-light-off
];

services = {
fprintd.enable = true;
Expand All @@ -47,7 +50,7 @@ in {
battery = {
governor = "powersave";
scaling_min_freq = mkDefault (MHz 1800);
scaling_max_freq = mkDefault (MHz 3600);
scaling_max_freq = mkDefault (MHz 3900);
turbo = "never";
};
charger = {
Expand Down Expand Up @@ -78,11 +81,11 @@ in {

boot = {
kernelModules = ["acpi_call"];
extraModulePackages = with config.boot.kernelPackages;
[
extraModulePackages =
(with config.boot.kernelPackages; [
acpi_call
cpupower
]
])
++ [pkgs.cpupower-gui];
};
security.pam.services.login.fprintAuth = true;
Expand All @@ -99,7 +102,7 @@ in {
};
# https://github.com/NixOS/nixpkgs/issues/114222
systemd.user.services.telephony_client.enable = false;
hardware.opengl = {
hardware.graphics = {
extraPackages = with pkgs; [vaapiIntel libva libvdpau-va-gl vaapiVdpau ocl-icd intel-compute-runtime];
extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiVdpau
Expand Down
1 change: 1 addition & 0 deletions system/core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
./nix.nix
./users.nix
./openssh.nix
./syncthing.nix
];
}
26 changes: 25 additions & 1 deletion system/core/impermanence.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,31 @@ in {
environment.persistence."/persist" = {
hideMounts = true;
directories =
[
# persist directories in user directory (stolen from n3oney)
builtins.map (v: {
directory = "/home/sioodmy/${v}";
user = "sioodmy";
group = "users";
}) (
[
"download"
"music"
"dev"
"docs"
"pics"
"vids"
"other"
]
++ forEach ["syncthing" "obs-studio" "Signal" "niri" "BraveSoftware" "nicotine" "ags"] (
x: ".config/${x}"
)
++ forEach ["tealdeer" "keepassxc" "nix" "starship" "nix-index" "mozilla" "go-build" "BraveSoftware" "zsh" "nvim"] (
x: ".cache/${x}"
)
++ forEach ["direnv" "TelegramDesktop" "PrismLauncher" "keyrings" "nicotine" "zoxide"] (x: ".local/share/${x}")
++ [".ssh" ".keepass" ".mozilla" ".thunderbird"]
)
++ [
# dirty fix for "no storage left on device" while rebuilding
# it gets wiped anyway
"/tmp"
Expand Down
6 changes: 6 additions & 0 deletions system/core/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
dev.enable = false;
};

# nixos-rebuild helper
programs.nh = {
enable = true;
flake = "/home/sioodmy/dev/dotfiles";
};

nix = {
# gc kills ssds
gc.automatic = lib.mkDefault false;
Expand Down
31 changes: 31 additions & 0 deletions system/core/syncthing.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{pkgs, ...}: {
services.syncthing = {
enable = true;
user = "sioodmy";
dataDir = "/persist/home/sioodmy/.config/syncthing";
configDir = "/persist/home/sioodmy/.config/syncthing";
guiAddress = "127.0.0.1:8384";

openDefaultPorts = true;
};
boot.kernel.sysctl."fs.inotify.max_user_watches" = 1048576;

# credits: Ramblurr
# https://github.com/Ramblurr/nixcfg/blob/7343640bd4f5474eeba3b115424c2b0ccc809858/hosts/unstable/x86_64-linux/quine/syncthing.nix#L103
# FIX: home-manager impermanence
# when using with home-manager impermanence we need to ensure that home-manager activates before
# syncthing. otherwise the syncthing init will create ~/.config/syncthing, but ~/.config will be created
# with root:root ownership.
systemd.services.syncthing.after = ["home-manager-sioodmy.service"];
systemd.services.syncthing-init.after = ["home-manager-sioodmy.service"];
systemd.services.syncthing-init.serviceConfig.ExecStartPost = pkgs.writeShellScript "rm-sync-dir" ''
if [ -d "$HOME/Sync" ]
then
rmdir "$HOME/Sync"
fi
'';

# yet another hacky workaround for race condition with impermanence
# https://github.com/nix-community/impermanence/issues/94
systemd.services.syncthing.serviceConfig.Type = "idle";
}
11 changes: 10 additions & 1 deletion system/core/users.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{pkgs, ...}: {
{
pkgs,
inputs,
...
}: {
imports = [
inputs.homix.nixosModules.default
];

programs.zsh.enable = true;
services.openssh = {
enable = true;
Expand All @@ -21,6 +29,7 @@
root.hashedPasswordFile = "/persist/secrets/root";
sioodmy = {
isNormalUser = true;
homix = true;
shell = pkgs.bashInteractive;
hashedPasswordFile = "/persist/secrets/sioodmy";
extraGroups = [
Expand Down
1 change: 1 addition & 0 deletions system/wayland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
./fonts.nix
./services.nix
./pipewire.nix
./packages.nix
inputs.niri.nixosModules.niri
inputs.andromeda.nixosModules.default
];
Expand Down
1 change: 1 addition & 0 deletions system/wayland/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
packages = with pkgs; [
material-icons
material-design-icons
emacs-all-the-icons-fonts
roboto
work-sans
comic-neue
Expand Down
24 changes: 24 additions & 0 deletions system/wayland/packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{pkgs, ...}: {
nixpkgs.config.allowUnfree = false;
environment.systemPackages = with pkgs; [
overskride
dart-sass

libreoffice-fresh
ytmdl
thunderbird
nicotine-plus
gnome.gnome-calculator
brave
inkscape
ledger-live-desktop
ledger_agent
tdesktop
calcurse
pulseaudio
signal-desktop
gimp
wireshark
keepassxc
];
}

0 comments on commit fc68244

Please sign in to comment.