This commit is contained in:
Morten Olsen
2023-09-16 12:33:21 +02:00
parent 6dbaad1bbe
commit 33f79566b7
65 changed files with 387 additions and 228 deletions

7
apply.sh Executable file
View File

@@ -0,0 +1,7 @@
name=$1
if [ -z "$name" ]; then
sudo nixos-rebuild switch --flake .
else
sudo nixos-rebuild switch --flake ".#$name"
fi

42
flake.lock generated
View File

@@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1694375657,
"narHash": "sha256-32X8dcty4vPXx+D4yJPQZBo5hJ1NQikALhevGv6elO4=",
"lastModified": 1694643239,
"narHash": "sha256-pv2k/5FvyirDE8g4TNehzwZ0T4UOMMmqWSQnM/luRtE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f7848d3e5f15ed02e3f286029697e41ee31662d7",
"rev": "d9b88b43524db1591fb3d9410a21428198d75d49",
"type": "github"
},
"original": {
@@ -20,11 +20,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1693718952,
"narHash": "sha256-+nGdJlgTk0MPN7NygopipmyylVuAVi7OItIwTlwtGnw=",
"lastModified": 1694710316,
"narHash": "sha256-uRh46iIC86D8BD1wCDA5gRrt+hslUXiD0kx/UjnjBcs=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "793de77d9f83418b428e8ba70d1e42c6507d0d35",
"rev": "570256327eb6ca6f7bebe8d93af49459092a0c43",
"type": "github"
},
"original": {
@@ -35,11 +35,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1693663421,
"narHash": "sha256-ImMIlWE/idjcZAfxKK8sQA7A1Gi/O58u5/CJA+mxvl8=",
"lastModified": 1694422566,
"narHash": "sha256-lHJ+A9esOz9vln/3CJG23FV6Wd2OoOFbDeEs4cMGMqc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e56990880811a451abd32515698c712788be5720",
"rev": "3a2786eea085f040a66ecde1bc3ddc7099f6dbeb",
"type": "github"
},
"original": {
@@ -51,11 +51,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1694183432,
"narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=",
"lastModified": 1694767346,
"narHash": "sha256-5uH27SiVFUwsTsqC5rs3kS7pBoNhtoy9QfTP9BmknGk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b",
"rev": "ace5093e36ab1e95cb9463863491bee90d5a4183",
"type": "github"
},
"original": {
@@ -65,11 +65,27 @@
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1694814340,
"narHash": "sha256-eo9444JGI/G9jZF+X3xmS5TMRuIT4VYPKyZQ11iF65Q=",
"owner": "nix-community",
"repo": "NUR",
"rev": "9b70f21fd41d3b96580e7ca4a3d1c29e87bdab36",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"nur": "nur"
}
}
},

View File

@@ -12,13 +12,15 @@
home-manager = {
url = "github:nix-community/home-manager";
};
nur.url = "github:nix-community/NUR";
};
outputs = { self, nixpkgs, nixos-hardware, home-manager }: {
outputs = { self, nixpkgs, nixos-hardware, home-manager, nur}: {
nixosConfigurations = {
alice-xps = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{ nixpkgs.overlays = [ nur.overlay ]; }
(import ./machines/xps/configuration.nix)
({
# Let 'nixos-version --json' know about the Git revision

View File

@@ -1 +0,0 @@
sudo nixos-rebuild switch --flake .

View File

@@ -1,21 +1,27 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
{
programs.zsh.enable = true;
users.users.alice = {
isNormalUser = true;
description = "Alice";
extraGroups = [ "networkmanager" "wheel" "docker" ];
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.zsh;
};
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"1password-gui"
"1password"
];
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
# Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = [ "alice" ];
};
home-manager.useGlobalPkgs = true;
home-manager.users.alice = import ./home.nix;
}

View File

@@ -1,44 +0,0 @@
[user]
email = fbtijfdq@void.black
name = Morten Olsen
signingkey = 0x4269430A8C3D09A8
[alias]
graph = log --graph --color --pretty=format:"%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%C(blue)%x20(%ce)%x20%C(cyan)[gpg:%GK%x20%G?]%C(reset)%n%x20%s%n"
ll = log --oneline
st = status -sb
cm = commit -m
append = commit --amend --no-edit
sobmodules = submodule update --init --recursive
df = difftool -t nvimdiff -y
last = log -1 --stat
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
brr = branch --remote --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
undo = reset HEAD~1 --mixed
unstage = reset HEAD --
[difftool "nvimdiff"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
[commit]
gpgsign = true
[url "git@gitlab.com:maersktankers/"]
insteadOf = https://gitlab.com/maersktankers/
[url "git@github.com:morten-olsen/"]
insteadOf = https://github.com/morten-olsen/
[url "git@github.com:0north/"]
insteadOf = https://github.com/0north/
[url "https://"]
insteadOf = git://
[core]
pager = delta
hooksPath = /dev/null
[interactive]
diffFilter = delta --color-only
[pull]
ff = only
[init]
defaultBranch = main

View File

@@ -1,8 +0,0 @@
font_family FiraCode Nerd Font Reg
bold_font FiraCode Nerd Font Bold
italic_font auto
bold_italic_font auto
disable_ligatures cursor
enable_audio_bell no
bell_on_tab no
background_opacity 0.8

View File

@@ -1,164 +1,33 @@
{ config, pkgs, ... }:
{ config, pkgs, lib,... }:
let
astronvim = builtins.fetchGit {
url = "https://github.com/AstroNvim/AstroNvim";
rev = "dad0bec1fef2833561d04ea446a544fbfde92539";
};
astronvimUser = builtins.fetchGit {
url = "https://foo:foo@github.com/morten-olsen/astrovim";
rev = "44b38567fe3adedd972b5b07f5883d47600a9078";
};
in {
{
home.username = "alice";
home.homeDirectory = "/home/alice";
imports = [
./programs/terminal
./programs/kitty
./programs/firefox
];
home.stateVersion = "23.11";
home.packages = [
pkgs.kitty
pkgs.eza
pkgs.bat
pkgs.fzf
pkgs.fd
pkgs.curl
pkgs.jq
pkgs.spotify
pkgs.slack
pkgs.rustup
pkgs.bitwarden
pkgs.bitwarden-cli
pkgs.silver-searcher
pkgs.ncspot
pkgs.ripgrep
pkgs.thefuck
pkgs.unzip
pkgs.nodejs
pkgs.gnumake
pkgs.gcc
pkgs.terraform
pkgs.darktable
pkgs.rawtherapee
pkgs.signal-desktop
pkgs.nodePackages.pnpm
pkgs.nodePackages.yarn
pkgs.nodePackages.yo
pkgs.steam-run
pkgs.python3
pkgs.gimp
pkgs.blender
pkgs.gh
pkgs.discord
pkgs.binutils
pkgs.pkg-config
];
programs.firefox.enable = true;
programs.zsh.enable = true;
programs.neovim.enable = true;
programs.tmux = {
enable = true;
extraConfig = builtins.readFile ./files/tmux/config;
};
programs.git.enable = true;
home.file = {
".gitconfig".source = ./files/git/config;
".tmux.conf".source = ./files/tmux/config;
".zshrc".source = ./files/zsh/config;
".bashrc".source = ./files/bash/config;
".shellrc/rc.d" = {
source = ./files/shell/rc.d;
};
".gnupg" = {
source = ./files/gpg;
recursive = true;
};
".oh-my-zsh" = {
source = builtins.fetchGit {
url = "https://github.com/ohmyzsh/ohmyzsh";
rev = "b07c8cfe692bc6c7702f0aef5d493b12dfb43392";
};
};
".config/zsh/custom/plugins/zsh-autosuggestions" = {
source = builtins.fetchGit {
url = "https://github.com/zsh-users/zsh-autosuggestions";
rev = "c3d4e576c9c86eac62884bd47c01f6faed043fc5";
};
};
".config/zsh/custom/plugins/zsh-syntax-highlighting" = {
source = builtins.fetchGit {
url = "https://github.com/zsh-users/zsh-syntax-highlighting";
rev = "143b25eb98aa3227af63bd7f04413e1b3e7888ec";
};
};
".config/zsh/custom/zsh-vi-mode" = {
source = builtins.fetchGit {
url = "https://github.com/jeffreytse/zsh-vi-mode";
rev = "1f28e1886dc8e49f41b817634d5c7695b6abb145";
};
};
".config/ssh" = {
source = ./files/ssh;
recursive = true;
};
".config/hypr" = {
source = ./files/hyprland;
recursive = true;
};
".config/kitty" = {
source = ./files/kitty;
recursive = true;
};
".config/eww" = {
source = ./files/eww;
recursive = true;
};
".config/wofi" = {
source = ./files/wofi;
recursive = true;
};
".config/nvim" = {
source = astronvim;
recursive = true;
};
".config/nvim/lua/user" = {
source = astronvimUser;
};
};
home.sessionVariables = {
# EDITOR = "emacs";
};
home.sessionVariables = {};
programs.home-manager.enable = true;
nixpkgs = {
overlays = [
(import ./overlays/steam.nix)
];
};
systemd.user.services.protonmail-bridge = {
Unit = {
Description = "Protonmail Bridge";
After = [ "network.target" ];
};
Service = {
Restart = "always";
ExecStart = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --no-window --noninteractive";
};
Install = {
WantedBy = [ "default.target" ];
};
};
}

View File

@@ -0,0 +1,44 @@
{ config, pkgs, ... }:
{
programs.firefox = {
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
extraPolicies = {
CaptivePortal = false;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
DisableFirefoxAccounts = false;
NoDefaultBookmarks = true;
OfferToSaveLogins = false;
OfferToSaveLoginsDefault = false;
PasswordManagerEnabled = false;
FirefoxHome = {
Search = true;
Pocket = false;
Snippets = false;
TopSites = false;
Highlights = false;
};
UserMessaging = {
ExtensionRecommendations = false;
SkipOnboarding = true;
};
};
};
profiles = {
default = {
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
duckduckgo-privacy-essentials
react-devtools
reduxdevtools
hoppscotch
bitwarden
grammarly
vimium
];
};
};
};
}

View File

@@ -0,0 +1,63 @@
{ config, pkgs, ... }:
{
imports = [
../gnupg
];
programs.git = {
enable = true;
userName = "Morten Olsen";
userEmail = "fbtijfdq@void.black";
signing = {
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFaIAP/ZJ7+7jeR44e1yIJjfQAB6MN351LDKJAXVF62P";
signByDefault = true;
};
aliases = {
graph = "log --graph --color --pretty=format:'%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%C(blue)%x20(%ce)%x20%C(cyan)[gpg:%GK%x20%G?]%C(reset)%n%x20%s%n'";
ll = "log --oneline";
st = "status -sb";
cm = "commit -m";
append = "commit --amend --no-edit";
sobmodules = "submodule update --init --recursive";
df = "difftool -t nvimdiff -y";
last = "log -1 --stat2";
br = "branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate";
brr = "branch --remote --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate";
undo = "reset HEAD~1 --mixed";
unstage = "reset HEAD --";
};
extraConfig = {
interactive = {
diffFilter = "delta --color-only";
};
init = {
defaultBranch = "main";
};
pull = {
ff = "only";
};
core = {
pager = "delta";
};
difftool = {
nvimdiff = {
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\"";
};
};
gpg = {
format = "ssh";
ssh = {
program = "${pkgs._1password-gui}/share/1password/op-ssh-sign";
};
};
url = {
"git@github.com:morten-olsen/" = {
insteadOf = "https://github.com/morten-olsen/";
};
"https://" = {
insteadOf = "git://";
};
};
};
};
}

View File

@@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
home.file = {
".gnupg" = {
source = ./files;
recursive = true;
};
};
}

View File

@@ -0,0 +1,25 @@
{ config, pkgs, ... }:
{
imports = [
../kitty
];
home.packages = [
pkgs.wl-clipboard
];
home.file = {
".config/hypr" = {
source = ./files/hypr;
recursive = true;
};
".config/eww" = {
source = ./files/eww;
recursive = true;
};
".config/wofi" = {
source = ./files/wofi;
recursive = true;
};
};
}

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,23 @@
{ config, pkgs, ... }:
{
programs.kitty = {
enable = true;
font = {
name = "FiraCode Nerd Font Mono Reg";
size = 12;
package = (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; });
};
settings = {
# Enable ligatures
draw_ligatures = true;
italic_font = "auto";
bold_italic_font = "auto";
disable_ligatures = "cursor";
enable_audio_bell = false;
bell_on_tab = false;
background_opacity = "0.8";
};
};
}

View File

@@ -0,0 +1,23 @@
{ config, pkgs, ... }:
let
astronvim = builtins.fetchGit {
url = "https://github.com/AstroNvim/AstroNvim";
rev = "dad0bec1fef2833561d04ea446a544fbfde92539";
};
astronvimUser = builtins.fetchGit {
url = "https://foo:foo@github.com/morten-olsen/astrovim";
rev = "44b38567fe3adedd972b5b07f5883d47600a9078";
};
in {
programs.neovim.enable = true;
home.file = {
".config/nvim" = {
source = astronvim;
recursive = true;
};
".config/nvim/lua/user" = {
source = astronvimUser;
};
};
}

View File

@@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
home.file = {
".ssh" = {
source = ./files;
recursive = true;
};
};
}

View File

@@ -3,5 +3,6 @@ Include ~/.ssh/config.d/*
Host *
Controlmaster auto
Controlpath ${TMPDIR}/ssh-%r@%h:%p
IdentityAgent ~/.1password/agent.sock

View File

@@ -0,0 +1,19 @@
{ config, pkgs, ... }:
{
home.packages = [
pkgs.steam-run,
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
nixpkgs = {
overlays = [
(import ./overlays/steam.nix)
];
};
}

View File

@@ -0,0 +1,69 @@
{ config, pkgs, ... }:
{
imports = [
../tmux
../ssh
../git
../neovim
];
home.packages = [
pkgs.eza
pkgs.bat
pkgs.fzf
pkgs.fd
pkgs.curl
pkgs.jq
pkgs.rustup
pkgs.bitwarden-cli
pkgs.silver-searcher
pkgs.ripgrep
pkgs.thefuck
pkgs.unzip
pkgs.nodejs
pkgs.gnumake
pkgs.gcc
pkgs.nodePackages.pnpm
pkgs.nodePackages.yarn
pkgs.nodePackages.yo
pkgs.python3
pkgs.gh
pkgs.binutils
pkgs.pkg-config
];
programs.zsh.enable = true;
home.file = {
".env".source = ./files/env;
".zshrc".source = ./files/zshrc;
".bashrc".source = ./files/bashrc;
".shellrc/rc.d" = {
source = ./files/shell/rc.d;
};
".oh-my-zsh" = {
source = builtins.fetchGit {
url = "https://github.com/ohmyzsh/ohmyzsh";
rev = "b07c8cfe692bc6c7702f0aef5d493b12dfb43392";
};
};
".config/zsh/custom/plugins/zsh-autosuggestions" = {
source = builtins.fetchGit {
url = "https://github.com/zsh-users/zsh-autosuggestions";
rev = "c3d4e576c9c86eac62884bd47c01f6faed043fc5";
};
};
".config/zsh/custom/plugins/zsh-syntax-highlighting" = {
source = builtins.fetchGit {
url = "https://github.com/zsh-users/zsh-syntax-highlighting";
rev = "143b25eb98aa3227af63bd7f04413e1b3e7888ec";
};
};
".config/zsh/custom/zsh-vi-mode" = {
source = builtins.fetchGit {
url = "https://github.com/jeffreytse/zsh-vi-mode";
rev = "1f28e1886dc8e49f41b817634d5c7695b6abb145";
};
};
};
}

View File

@@ -0,0 +1 @@
GH_TOKEN=op://2w4xwvwqj6r33yqeaxbwanup6q/olcqxk6mox3a5ytzslws3itf3m/GH_TOKEN

View File

@@ -0,0 +1,26 @@
function _bw_replace_env() {
env | while IFS= read -r line; do
value=${line#*=}
name=${line%%=*}
if [[ $value = bw://* ]]; then;
item=${value:5}
secret=`bw get password $item`
export $name="$secret"
fi
done
}
function clam-open() {
command=$1
if [[ -z "$BW_SESSION" ]]; then;
export BW_SESSION=`bw unlock --raw`
fi
_bw_replace_env
if [[ ! -z "$command" ]]; then;
eval $command
fi
}
function clam-close() {
unset BW_SESSION
}

View File

@@ -1,19 +1,6 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
# if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
# source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
# fi
# POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
# [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-$HOME/.cache}
export ZSH="$HOME/.oh-my-zsh"
export ZSH_CUSTOM="$HOME/.config/zsh/custom"
#ZSH_THEME="powerlevel10k/powerlevel10k"
#ZSH_THEME="spaceship"
ZSH_THEME="robbyrussell"
plugins=(
@@ -45,6 +32,9 @@ if [ -d $HOME/.shellrc/rc.d ]; then
for file in $HOME/.shellrc/rc.d/*.sh; do
source $file
done
for file in $HOME/.shellrc/rc.d/*.zsh; do
source $file
done
fi
# Load all files from .shell/zshrc.d directory

View File

@@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
programs.tmux = {
enable = true;
extraConfig = builtins.readFile ./files/config;
};
}