This commit is contained in:
Jacob Hrbek 2021-06-27 22:49:48 +02:00
commit 50f8176e0c
7 changed files with 90 additions and 0 deletions

33
home.nix Normal file

@ -0,0 +1,33 @@
### Initialization file used to deploy network-wide configuration
# Reference by real-life examples:
# - https://github.com/balsoft/nixos-config
# - https://github.com/MatthewCroughan/nixcfg
{ config, lib, ... }:
let
# Global variables
homeNixDir = "$HOME/.local/share/home-manager";
# NOTE(Krey): Handling of https://github.com/NixOS/nixpkgs/issues/128286
nixFilesIn = path:
let
names = lib.filter (lib.hasSuffix ".nix") (lib.attrNames (builtins.readDir path));
in
map (x: path + "/${x}") names;
in {
imports = [
(/. + "${homeNixDir}" + /users/kreyren.nix)
(import "${homeNixDir}/machines/${config.networking.hostName}.nix" {inherit homeNixDir;})
] ++ nixFilesIn "${homeNixDir}/programs/";
# Use preferred location for home-manager
programs.home-manager.path = "${homeNixDir}";
# Global packages
programs.bash.enable = true;
programs.vim.enable = true;
programs.gpg.enable = true;
programs.htop.enable = true;
}

4
machines/leonid.nix Normal file

@ -0,0 +1,4 @@
{ config, pkgs, ... }: {
# NOTE(Krey): Just so there is something here
programs.vim.enable = true;
}

28
programs/firefox.nix Normal file

@ -0,0 +1,28 @@
{ pkgs, ... }: {
programs.firefox = {
profiles = {
myprofile = {
settings = {
"general.smoothScroll" = false;
# Tor integration
## FIXME(Krey): Apply this only if tor is present
"network.proxy.socks" = "127.0.0.1";
"network.proxy.socks_port" = "9050";
"network.proxy.socks_remote_dns" = true;
};
};
};
# NOTE(Krey): List of exensions https://nur.nix-community.org/repos/rycee/
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
https-everywhere
privacy-badger
clearurls
keepassxc-browser
sponsorblock
decentraleyes
ublock-origin
darkreader
videospeed
privacy-redirect
];
}

7
programs/git.nix Normal file

@ -0,0 +1,7 @@
{ ... }: {
programs.git = {
userName = "Jacob Hrbek";
userEmail = "kreyren@fsfe.org";
# FIXME(Krey): Use tor for proxy if it's set up on the system
};
}

4
programs/gpg.nix Normal file

@ -0,0 +1,4 @@
{ config, ... }: {
# Git integration
programs.git.signing.signByDefault = config.programs.git.enable;
}

7
programs/ssh.nix Normal file

@ -0,0 +1,7 @@
{ services, ... }: {
programs.ssh = {
proxyCommand = if(services.tor.torsocks.enable == true)
then "torsocks"
else null;
};
}

7
programs/vim.nix Normal file

@ -0,0 +1,7 @@
{ ... }: {
programs.vim = {
settings = {
number = true;
};
};
}