Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sruxps] NixOS -> Ubuntu #23

Merged
merged 8 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[sruxps] NixOS -> Ubuntu (WIP)
  • Loading branch information
yurrriq committed May 21, 2022
commit cf0a57b4ff8b526d7354e322337eb21658b84111
12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- files: ^.pre-commit-config.yaml$
id: check-yaml
name: Check pre-commit config
repo: git://github.com/pre-commit/pre-commit-hooks
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
- hooks:
- args: ["--format=tty"]
Expand All @@ -21,9 +21,17 @@ repos:
id: shell-lint
name: Lint .envrc
types: [text]
repo: git://github.com/detailyang/pre-commit-shell
repo: https://github.com/detailyang/pre-commit-shell
rev: v1.0.6
- hooks:
- description: Scan Nix files for dead code
id: deadnix
name: deadnix
entry: deadnix --edit --fail --no-lambda-arg --no-lambda-pattern-names
language: system
files: \.nix$
exclude: |-
pkgs/development/node-packages/node-env\.nix$
- description: Format nix code with nixpkgs-fmt.
id: nixpkgs-fmt
name: nixpkgs-fmt
Expand Down
2 changes: 2 additions & 0 deletions .stow-local-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ scripts
.sops.yaml
src
.stow-local-ignore
todo
TODO.txt
VERSION
.yamllint
35 changes: 35 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# https://gist.github.com/freizl/3246474#file-xmonad-desktop-L1

setxkbmap -option "ctrl:nocaps,compose:ralt"

sudo apt install curl git network-manager-openconnect

sh <(curl -L https://nixos.org/nix/install) --daemon

echo "export NIX_PATH=$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels${NIX_PATH:+:$NIX_PATH}" >>~/.bashrc

mkdir -p ~/.config/nix
echo "experimental-features = flakes nix-command" >>~/.config/nix/nix.conf

nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager
nix-channel --update
nix-shell '<home-manager>' -A install

rmdir ~/.local/share/applications
ln -s ~/.nix-profile/share/applications ~/.local/share/

sudo snap install zoom-client

# λ xinput list --name-only | grep -m1 Touchpad | xargs -I% xinput list --id-only '%'
# 13

xinput --set-prop 13 "libinput Accel Speed" 1
xinput --set-prop 13 "libinput Tapping Enabled" 1

# Fix/replace xbacklight

# programs.ssh and/or this ~/.ssh/config
# Host 10.*.*.*
# LogLevel QUIET
# StrictHostKeyChecking accept-new
# UserKnownHostsFile /dev/null
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.24.1
3.0.0
3 changes: 1 addition & 2 deletions modules/applications.nix → config/applications.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; (
home.packages = with pkgs; (
[
clementine
pavucontrol
Expand All @@ -10,7 +10,6 @@
) ++ lib.optionals stdenv.isLinux (
[
qpdfview
(signal-desktop.override { spellcheckerLanguage = "en_US"; })
]
);
}
7 changes: 2 additions & 5 deletions modules/clis.nix → config/clis.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; (
home.packages = with pkgs; (
[
(aspellWithDicts (dicts: [ dicts.en dicts.es dicts.nb dicts.sv ]))
ansifilter
bind
curl
httpie
cachix
nixUnstable
gnutar
gzip
unzip
Expand All @@ -28,10 +26,9 @@
xclip
yq
mdcat
smos
# smos
nixpkgs-fmt
nixpkgs-review
playerctl
wirelesstools
]
) ++ lib.optionals stdenv.isLinux [
Expand Down
7 changes: 1 addition & 6 deletions config/dunst.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
font = "Iosevka Term 10";
markup = "yes";
plain_text = "no";
format = "<b>%s</b>\n%b";
format = "<b>%s</b>\\n%b";
sort = "yes";
indicate_hidden = "yes";
alignment = "center";
Expand Down Expand Up @@ -43,11 +43,6 @@
frame_width = 0;
frame_color = "#8EC07C";
};
shortcuts = {
close = "mod4+space";
close_all = "mod4+mod1+space";
history = "ctrl+grave";
};
urgency_low = {
frame_color = "#3B7C87";
foreground = "#3B7C87";
Expand Down
7 changes: 7 additions & 0 deletions config/fonts.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ pkgs, ... }:
{
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
(nerdfonts.override { fonts = [ "Iosevka" ]; })
];
}
110 changes: 56 additions & 54 deletions config/git/config.nix
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:

{

programs.git.extraConfig = {
programs.git = {
delta = {
enable = true;
options = {
plus-style = "syntax #012800";
minus-style = "syntax #340001";
syntax-theme = "Monokai Extended";
navigate = true;
};
};

color = {
diff-highlight = {
oldNormal = "red bold";
oldHighlight = "red bold 52";
newNormal = "green bold";
newHighlight = "green bold 22";
extraConfig = {
color = {
diff-highlight = {
oldNormal = "red bold";
oldHighlight = "red bold 52";
newNormal = "green bold";
newHighlight = "green bold 22";
};

diff = {
meta = 227;
frag = "magenta bold";
commit = "227 bold";
old = "red bold";
new = "green bold";
whitespace = "red reverse";
};

status = {
added = "green";
changed = "yellow";
untracked = "cyan";
};
ui = true;
};

commit.template = "${config.xdg.dataHome}/git/commit.template";

credential = {
helper = "${pkgs.gitAndTools.pass-git-helper}/bin/pass-git-helper";
useHttpPath = true;
};

diff = {
meta = 227;
frag = "magenta bold";
commit = "227 bold";
old = "red bold";
new = "green bold";
whitespace = "red reverse";
sopsdiffer = {
textconv = "sops -d";
};
};

status = {
added = "green";
changed = "yellow";
untracked = "cyan";
difftool = {
pdfdiffer.cmd = "diff-pdf --view \"$LOCAL\" \"$REMOTE\"";
prompt = false;
trustExitCode = true;
};
ui = true;
};

commit.template = "${config.xdg.dataHome}/git/commit.template";
fetch.prune = true;

core.pager = "delta";
init.defaultBranch = "main";

credential = {
helper = "${pkgs.gitAndTools.pass-git-helper}/bin/pass-git-helper";
useHttpPath = true;
};
pull.ff = "only";

delta = {
plus-style = "syntax #012800";
minus-style = "syntax #340001";
syntax-theme = "Monokai Extended";
navigate = true;
};
rerere.enabled = true;

diff = {
sopsdiffer = {
textconv = "sops -d";
url."[email protected]:" = {
insteadOf = "https://gitlab.sportradar.ag/";
};
};

difftool = {
pdfdiffer.cmd = "diff-pdf --view \"$LOCAL\" \"$REMOTE\"";
prompt = false;
trustExitCode = true;
};

fetch.prune = true;

init.defaultBranch = "main";

interactive.diffFilter = "delta --color-only";

pull.ff = "only";

rerere.enabled = true;

url."[email protected]:" = {
insteadOf = "https://gitlab.sportradar.ag/";
};
lfs.enable = true;
};

xdg.configFile."pass-git-helper/git-pass-mapping.ini" = {
Expand Down
1 change: 0 additions & 1 deletion config/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"*~"
".DS_Store"
];
lfs.enable = true;
} // (
with config.accounts.email.accounts.primary; {
signing.key = gpg.key;
Expand Down
19 changes: 19 additions & 0 deletions config/git/lab.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:

let
tomlFormat = pkgs.formats.toml { };
in

{
home.packages = [
pkgs.gitAndTools.lab
];
} // lib.mkIf (config.programs.password-store.enable) {
xdg.configFile."lab/lab.toml".source = tomlFormat.generate "lab-config" {
core = {
host = "https://gitlab.sportradar.ag";
load_token = "pass gitlab.sportradar.ag/token/api";
user = "e.bailey";
};
};
}
4 changes: 1 addition & 3 deletions config/git/packages.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{ lib, pkgs, ... }:
{ pkgs, ... }:

{
home.packages = with pkgs; (
[
delta
diff-pdf
git
git-lfs
github-cli
kdiff3
nix-prefetch-git
Expand Down
4 changes: 2 additions & 2 deletions config/kitty.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ lib, pkgs, ... }:

{

Expand All @@ -19,7 +19,7 @@
};
settings = {
editor = ''emacsclient -nw -a ""'';
font_size = 24;
font_size = lib.mkDefault 24;
kitty_mod = "ctrl+shift";
scrollback_lines = -1;
shell = ".";
Expand Down
29 changes: 29 additions & 0 deletions config/nix.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ config, pkgs, ... }:

{
nix = {
package = pkgs.nixUnstable;

settings = {
experimental-features = [
"flakes"
"nix-command"
];

substituters = [
"https://cache.nixos.org"
"https://sportradar.cachix.org"
"https://yurrriq.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"sportradar.cachix.org-1:6MyCzOfUMeMTxU5QnogkyYOBtr5f5atW/qeS+TjmUfE="
"yurrriq.cachix.org-1:evpJ5wKluf7QOCcv69VkIxCOtHgubrqXlZpp3JAXLBE="
];
trusted-users = [
"root"
config.home.username
];
};
};
}
17 changes: 17 additions & 0 deletions config/rofi.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ ... }:

{
imports = [
./fonts.nix
];

programs.rofi = {
enable = true;
font = "Iosevka Term 18";
pass = {
enable = true;
stores = [ "~/.password-store" ];
};
theme = "purple";
};
}
6 changes: 6 additions & 0 deletions config/screen-locker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

{

home.file.".xmonad/matrix.png".source = ./matrix.png;

home.packages = with pkgs; [
i3lock
];

services.screen-locker = {
enable = true;
inactiveInterval = 5;
Expand Down
Loading