thelio76: firefox and refactor

This commit is contained in:
Alex 2024-07-26 18:27:47 -04:00
parent d2e3f47366
commit 448bf425c3
5 changed files with 127 additions and 82 deletions

View File

@ -22,6 +22,44 @@
"url": "https://git.atauno.com/atau/atau-nixpkgs" "url": "https://git.atauno.com/atau/atau-nixpkgs"
} }
}, },
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1721859466,
"narHash": "sha256-SDLXa2YZiQpsgxPJanbsBETI9LWEHaw+ZgCn0Jb2/HI=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "e37c395b486aa4fde1dbffd57de6ed5c22eb6495",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -61,6 +99,7 @@
"root": { "root": {
"inputs": { "inputs": {
"atau-nixpkgs": "atau-nixpkgs", "atau-nixpkgs": "atau-nixpkgs",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

100
flake.nix
View File

@ -1,75 +1,79 @@
{ {
description = "Alex's super mega awesome nixos config"; description = "Alex's super mega awesome nixos config";
# A flake's inputs specify the dependencies that get pulled in. Each input is pinned to a specific version (the git commit) of that dependency.
inputs = { inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable; nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
# unstable.url = "nixpkgs/nixos-unstable";
atau-nixpkgs.url = "git+https://git.atauno.com/atau/atau-nixpkgs?ref=main&rev=1e72f4b1e9b7a2991e3ccdebbe75d312f016da3b"; home-manager = {
atau-nixpkgs.inputs.nixpkgs.follows = "nixpkgs"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; # This flake also takes in nixpkgs as its own input, so we can override it here to ensure the same pkgs are used!
};
home-manager.url = "github:nix-community/home-manager"; firefox-addons = {
home-manager.inputs.nixpkgs.follows = "nixpkgs"; url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
atau-nixpkgs = {
url = "git+https://git.atauno.com/atau/atau-nixpkgs?ref=main&rev=1e72f4b1e9b7a2991e3ccdebbe75d312f016da3b";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, home-manager, ... }@attrs: outputs = { self, nixpkgs, home-manager, firefox-addons, ... }@attrs:
# let
# # system = "x86_64-linux";
# # pkgs = import nixpkgs {
# # # inherit system;
# # config.allowUnfree = true;
# # overlays = [ atau-nixpkgs.overlays.default ];
# # };
# in
{ {
nixosConfigurations.nixos76 = nixpkgs.lib.nixosSystem { nixosConfigurations = {
system = "x86_64-linux"; ## ---- personal computers (linux) ----
modules = [ nixos76 = nixpkgs.lib.nixosSystem {
./nixos76/system/configuration.nix system = "x86_64-linux";
home-manager.nixosModules.home-manager modules = [
{ ./nixos76/system/configuration.nix
home-manager.useGlobalPkgs = true; home-manager.nixosModules.home-manager
home-manager.useUserPackages = true; {
home-manager.backupFileExtension = "backup"; home-manager.useGlobalPkgs = true;
home-manager.users.alex = import ./nixos76/alex/home.nix; home-manager.useUserPackages = true;
# Optionally, use home-manager.extraSpecialArgs to pass home-manager.backupFileExtension = "backup";
# arguments to home.nix home-manager.users.alex = import ./nixos76/alex/home.nix;
} # Optionally, use home-manager.extraSpecialArgs to pass
]; # arguments to home.nix
}; }
nixosConfigurations.thelio76 = nixpkgs.lib.nixosSystem { ];
system = "x86_64-linux"; };
modules = [ thelio76 = nixpkgs.lib.nixosSystem rec {
./thelio76/configuration.nix system = "x86_64-linux";
home-manager.nixosModules.home-manager modules = [
{ ./thelio76/configuration.nix
home-manager.useGlobalPkgs = true; home-manager.nixosModules.home-manager
home-manager.useUserPackages = true; {
home-manager.backupFileExtension = "backup"; home-manager.useGlobalPkgs = true;
home-manager.users.alex = import ./nixos76/alex/home.nix; home-manager.useUserPackages = true;
} home-manager.backupFileExtension = "backup";
]; home-manager.users.alex = import ./nixos76/alex/home.nix;
}; home-manager.extraSpecialArgs = { ff = firefox-addons.packages.${system}; };
nixosConfigurations.ursa-minor = nixpkgs.lib.nixosSystem }
{ ];
};
## ---- servers ----
ursa-minor = nixpkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [
./ursa-minor/configuration.nix ./ursa-minor/configuration.nix
]; ];
}; };
nixosConfigurations.ursa-major = nixpkgs.lib.nixosSystem ursa-major = nixpkgs.lib.nixosSystem {
{
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [
./ursa-major/configuration.nix ./ursa-major/configuration.nix
]; ];
}; };
nixosConfigurations.atauno = nixpkgs.lib.nixosSystem atauno = nixpkgs.lib.nixosSystem {
{
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [
./atauno/configuration.nix ./atauno/configuration.nix
]; ];
}; };
};
}; };
} }

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, ff, ... }:
{ {
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
@ -67,38 +67,19 @@
}; };
firefox = { firefox = {
enable = true; enable = true;
# policies = { profiles.default = {
# ExtensionSettings = with builtins; settings = {
# let "extensions.autoDisableScopes" = 0;
# extension = shortId: uuid: {
# name = uuid;
# value = {
# install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
# installation_mode = "normal_installed";
# };
# };
# in
# listToAttrs [
# # (extension "tree-style-tab" "treestyletab@piro.sakura.ne.jp")
# (extension "ublock-origin" "uBlock0@raymondhill.net")
# # (extension "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}")
# # (extension "tabliss" "extension@tabliss.io")
# (extension "umatrix" "uMatrix@raymondhill.net")
# # (extension "libredirect" "7esoorv3@alefvanoon.anonaddy.me")
# # (extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}")
# ];
# };
profiles = {
default = {
containers = {
google = {
color = "green";
id = 1;
};
};
}; };
extensions = with ff; [
darkreader
multi-account-containers
ublock-origin
umatrix
];
}; };
}; };
git = { git = {
enable = true; enable = true;
userEmail = "alexmat2on@protonmail.com"; userEmail = "alexmat2on@protonmail.com";

View File

@ -30,6 +30,7 @@
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# What was this for? maybe wireguard?
networking.firewall = { networking.firewall = {
allowedUDPPorts = [ 51820 22000 ]; # Clients and peers can use the same port, see listenport allowedUDPPorts = [ 51820 22000 ]; # Clients and peers can use the same port, see listenport
allowedTCPPorts = [ 22000 48412 62109 ]; allowedTCPPorts = [ 22000 48412 62109 ];

View File

@ -1,14 +1,34 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
if [ -z "$(git status --porcelain)" ] function yes_or_no {
then while true; do
read -p "$* [y/n]: " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) echo "Aborted" ; return 1 ;;
esac
done
}
function apply() {
git push --force-with-lease git push --force-with-lease
rev=$(git rev-parse HEAD) rev=$(git rev-parse HEAD)
sudo nixos-rebuild switch \ sudo nixos-rebuild switch \
--flake "git+https://git.atauno.com/atau/nixos-config.git?ref=main&rev=$rev" --flake "git+https://git.atauno.com/atau/nixos-config.git?ref=main&rev=$rev"
}
function commit_and_apply() {
read -p "Enter a commit message: " msg
git add .
git commit -m "$(hostname): $msg"
apply
}
if [ -z "$(git status --porcelain)" ]
then
apply
else else
echo "Git working directory is unclean, please commit changes" yes_or_no "Git working directory is unclean, would you like to commit changes?" && commit_and_apply
exit 1
fi fi