desko/lappy: factor out some easy commonalities

i'm sure this will change as i mess with the rpi image
This commit is contained in:
colin 2022-05-22 01:59:04 -07:00
parent 33d2666a03
commit e9dbbb764f
8 changed files with 9 additions and 190 deletions

View File

@ -1,4 +1,8 @@
{ home-manager, config, pkgs, ... }:
{
imports = [ ./homes.nix ./users.nix ./hardware.nix ];
imports = [
./../common/homes.nix
./../common/users.nix
./hardware.nix
];
}

View File

@ -1,120 +0,0 @@
# docs:
# https://rycee.gitlab.io/home-manager/
# man home-configuration.nix
{ config, pkgs, ... }:
{
home.stateVersion = "21.11";
home.username = "colin";
home.homeDirectory = "/home/colin";
programs.home-manager.enable = true;
programs.zsh.enable = true;
programs.git = {
enable = true;
userName = "colin";
userEmail = "colin@uninsane.org";
};
programs.firefox = {
enable = true;
# profiles.default = {
# settings = {
# "browser.urlbar.placeholderName" = "DuckDuckGo";
# };
# };
# extensions = [
# ];
};
programs.vim = {
enable = true;
extraConfig = ''
" wtf vim project: NOBODY LIKES MOUSE FOR VISUAL MODE
set mouse-=a
" copy/paste to system clipboard
set clipboard=unnamedplus
" <tab> completion menu settings
set wildmenu
set wildmode=longest,list,full
" highlight all matching searches (using / and ?)
set hlsearch
" allow backspace to delete empty lines in insert mode
set backspace=indent,eol,start
" built-in syntax highlighting
syntax enable
" show line/col number in bottom right
set ruler
" highlight trailing space & related syntax errors (does this work?)
let c_space_errors=1
let python_space_errors=1
'';
};
dconf.settings = {
# control alt-tab behavior
"org/gnome/desktop/wm/keybindings" = {
switch-applications = [ "<Super>Tab" ];
switch-applications-backward=[];
switch-windows=["<Alt>Tab"];
switch-windows-backward=["<Super><Alt>Tab"];
};
# idle power savings
"org/gnome/settings-deamon/plugins/power" = {
idle-brigthness = 50;
sleep-inactive-ac-type = "nothing";
sleep-inactive-battery-timeout = 5400; # seconds
};
};
# xsession.enable = true;
# xsession.windowManager.command = "…";
home.packages = [
pkgs.btrfs-progs
pkgs.gnumake
pkgs.dig
pkgs.duplicity
pkgs.fatresize
pkgs.fd
pkgs.file
pkgs.gptfdisk
pkgs.hdparm
pkgs.htop
pkgs.iftop
pkgs.iotop
pkgs.iptables
pkgs.jq
pkgs.killall
pkgs.lm_sensors # for sensors-detect
pkgs.lsof
pkgs.pciutils
pkgs.matrix-synapse
pkgs.mix2nix
pkgs.netcat
pkgs.nixUnstable
# pkgs.nixos-generators
# pkgs.nettools
pkgs.nmap
pkgs.parted
pkgs.powertop
pkgs.python3
pkgs.ripgrep
pkgs.smartmontools
pkgs.snapper
pkgs.socat
pkgs.sudo
pkgs.telnet
pkgs.usbutils
pkgs.wireguard
pkgs.zola
pkgs.clinfo
pkgs.discord
pkgs.element-desktop
pkgs.gnome.dconf-editor
pkgs.mesa-demos
pkgs.tdesktop
];
}

View File

@ -1,4 +1,7 @@
{ home-manager, config, pkgs, ... }:
{
imports = [ ./homes.nix ./users.nix ./hardware.nix ];
imports = [
./../common/homes.nix
./../common/users.nix
./hardware.nix ];
}

View File

@ -1,8 +0,0 @@
{ home-manager, config, pkgs, ... }:
{
imports = [ home-manager.nixosModule ];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.colin.imports = [ ./colin.nix ];
}

View File

@ -1,60 +0,0 @@
{ config, pkgs, lib, ... }:
# installer docs: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/installation-device.nix
{
# Users are exactly these specified here;
# old ones will be deleted (from /etc/passwd, etc) upon upgrade.
users.mutableUsers = false;
# docs: https://nixpkgs-manual-sphinx-markedown-example.netlify.app/generated/options-db.xml.html#users-users
users.users.colin = {
# sets group to "users" (?)
isNormalUser = true;
home = "/home/colin";
uid = 1000;
# XXX colin: this is what the installer has, but is it necessary?
# group = "users";
extraGroups = [ "wheel" "networkmanager" ];
initialHashedPassword = "";
# shell = pkgs.bashInteractive;
# XXX colin: create ssh key for THIS user by logging in and running:
# ssh-keygen -t ed25519
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGSDe/y0e9PSeUwYlMPjzhW0UhNsGAGsW3lCG3apxrD5 colin@colin.desktop"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG+MZ/l5d8g5hbxMB9ed1uyvhV85jwNrSVNVxb5ujQjw colin@colin.laptop"
];
};
# automatically log in at the virtual consoles.
# using root here makes sure we always have an escape hatch
# services.getty.autologinUser = "root";
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
services.openssh = {
enable = true;
permitRootLogin = "no";
passwordAuthentication = false;
};
programs.vim.defaultEditor = true;
# gitea doesn't create the git user
# users.users.git = {
# description = "Gitea Service";
# home = "/var/lib/gitea";
# useDefaultShell = true;
# group = "gitea";
# isSystemUser = true;
# # sendmail access (not 100% sure if this is necessary)
# extraGroups = [ "postdrop" ];
# };
# # this is required to allow pleroma to send email.
# # raw `sendmail` works, but i think pleroma's passing it some funny flags or something, idk.
# # hack to fix that.
# users.users.pleroma.extraGroups = [ "postdrop" ];
}