Skip to content

Commit

Permalink
Merge pull request #23 from yurrriq/ubuntu
Browse files Browse the repository at this point in the history
[sruxps] NixOS -> Ubuntu
  • Loading branch information
yurrriq authored Jul 26, 2022
2 parents ed3d00d + 3d08c95 commit 1886127
Show file tree
Hide file tree
Showing 43 changed files with 775 additions and 678 deletions.
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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ diff: build
@ nix store diff-closures /run/current-system ./result


.PHONY: build-hm switch-hm

build-hm switch-hm:
@ home-manager --impure --flake .#ebailey ${@:-hm=}

.PHONY: cachix
cachix: cachix/cachix.dhall
@ mkdir -p ~/.config/$@ $@
Expand Down
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
3 changes: 2 additions & 1 deletion 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 @@ -46,6 +46,7 @@
shortcuts = {
close = "mod4+space";
close_all = "mod4+mod1+space";
# context = "ctrl+shift+period";
history = "ctrl+grave";
};
urgency_low = {
Expand Down
2 changes: 1 addition & 1 deletion config/fish/abbrs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{

programs.fish.shellAbbrs = {
aal = "aws-azure-login --no-prompt";
da = "direnv allow";
dn = "direnv deny";
dr = "direnv reload";
kc = "kubectl";
kcd = "kubectl drain --delete-emptydir-data --ignore-daemonsets";
kcn = "kubectl --namespace";
kcnp = "kubectl get pods --field-selector=spec.nodeName=";
kcx = "kubectl --context";
kg = "kubectl get";
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
Expand Up @@ -2,74 +2,76 @@

{

programs.git.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";
programs.git = {
delta = {
enable = true;
options = {
plus-style = "syntax #012800";
minus-style = "syntax #340001";
syntax-theme = "Monokai Extended";
navigate = true;
};
ui = true;
};

commit.template = "${config.xdg.dataHome}/git/commit.template";
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;
};

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

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

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

diff = {
sopsdiffer = {
textconv = "sops -d";
credential = {
helper = "${pkgs.gitAndTools.pass-git-helper}/bin/pass-git-helper";
useHttpPath = true;
};
};

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

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

init.defaultBranch = "main";
fetch.prune = true;

interactive.diffFilter = "delta --color-only";
init.defaultBranch = "main";

pull.ff = "only";
pull.ff = "only";

rerere.enabled = true;
rerere.enabled = true;

url."[email protected]:" = {
insteadOf = "https://gitlab.sportradar.ag/";
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
];
};
};
}
Loading

0 comments on commit 1886127

Please sign in to comment.