Skip to content

Commit

Permalink
Scimitar config stable
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeChannings committed Aug 28, 2024
1 parent f34ab1b commit 4e09431
Show file tree
Hide file tree
Showing 27 changed files with 356 additions and 237 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ devenv.local.nix
result

*.qcow2

.env
2 changes: 1 addition & 1 deletion config/atuin/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ctrl_n_shortcuts = true;
dialect = "uk";
filter_mode = "host";
filter_mode_shell_up_key_binding = "directory";
filter_mode_shell_up_key_binding = "session";
style = "compact";
inline_height = 5;
show_help = false;
Expand Down
9 changes: 1 addition & 8 deletions config/bat/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
style = "plain";
};

extraPackages = builtins.attrValues {
inherit (pkgs.bat-extras)
batdiff
batman
batgrep
batwatch
;
};
extraPackages = builtins.attrValues { inherit (pkgs.bat-extras) batman batgrep batwatch; };
};
}
6 changes: 3 additions & 3 deletions config/chromium/chromium-macos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
cpio,
}:
let
version = "127.0.6533.88-1.1";
version = "127.0.6533.119-1.1";
in
stdenv.mkDerivation rec {
name = "chromium";
Expand All @@ -28,9 +28,9 @@ stdenv.mkDerivation rec {
}-macos-signed.dmg";
hash =
if stdenv.isAarch64 then
"sha256-4YoFYTZrG1UexMgU2QOQ9V+c4mEmqyUHaUZdAfVezkY="
"sha256-2mENjHOQ/cN1So+7XhlOAx/Q0hkm3x/4KcadPK3rcCM="
else
"sha256-px45f0tXBo/gUzXdpb7i7ZtELHLgjhMFDsYw9XhuxOQ=";
"sha256-BlSdADfbe4PSSYIZa2mJRHItlB3ltY7DB4D7YrRZ/Qo=";
};

nativeBuildInputs = [
Expand Down
41 changes: 41 additions & 0 deletions config/chromium/update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const repo = 'claudiodekker/ungoogled-chromium-macos'

const request = await fetch(`https://api.github.com/repos/${repo}/releases/latest`, {
headers: {
accept: ' application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28'
}
})

if (!request.ok) {
console.error(`Failed to fetch the latest release metadata for github:${repo}`)
Deno.exit(1)
}

const releaseMetadata = await request.json()

const version = releaseMetadata.name;

console.log(`Latest release: ${version}`)

for (const asset of releaseMetadata.assets) {
console.log(`Asset: ${asset.name}`)

const sha256Hash = await $("nix-prefetch-url", asset.browser_download_url)
const sriHash = await $("nix-hash", "--type", "sha256", "--to-sri", sha256Hash.trim())

console.log(` SRI: ${sriHash}`)
console.log(` SHA256: ${sha256Hash}`)
}

async function $(name, ...args) {
const command = new Deno.Command(name, { args })

const { code, stdout, stderr } = await command.output();

if (code !== 0) {
console.log(`${name}: exited ${code} with ${new TextDecoder().decode(stderr)}`)
}

return new TextDecoder().decode(stdout);
}
14 changes: 7 additions & 7 deletions config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ let
inputs,
self,
pkgs,
pkgs-unstable,
...
}:
let
Expand All @@ -77,8 +76,13 @@ let
};

home-manager = {
backupFileExtension = "backup";

sharedModules = [
{ home.stateVersion = stateVersion; }
{
home.stateVersion = stateVersion;
nix.package = lib.mkForce pkgs.nixVersions.latest;
}
] ++ (with builtins; attrValues (removeAttrs homeModules cfg.disabledHmConfigs));
# Use the system-level nixpkgs instead of Home Manager's
useGlobalPkgs = true;
Expand All @@ -87,11 +91,7 @@ let
# using multiple profiles for one user
useUserPackages = true;

# Initialise home-manager users to system users.
# users = builtins.trace (builtins.attrNames config.users.users) {};

backupFileExtension = "backup";
extraSpecialArgs.pkgs-unstable = pkgs-unstable;
extraSpecialArgs.pkgs = pkgs;
};
};
}
Expand Down
20 changes: 1 addition & 19 deletions config/defaults/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,10 @@ in
"show-recents" = false;
};
"com.apple.WindowManager" = {
GloballyEnabled = true;
GloballyEnabled = false;
GloballyEnabledEver = true;
};
"com.apple.TextEdit" = {
"RichText" = false;
"SmartQuotes" = false;
};
};
};

home-manager.sharedModules = [
(
{ lib, ... }:
{
home.activation.setDarwinDefaults = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
if [ -e /usr/bin/killall ]; then
verboseEcho "Restarting Dock"
/usr/bin/killall Dock
fi
'';
}
)
];
};
}
1 change: 1 addition & 0 deletions config/helix/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
config = {
programs.helix = {
enable = true;
defaultEditor = true;

settings = (lib.importTOML ./config.toml);

Expand Down
11 changes: 7 additions & 4 deletions config/nix/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
];
settings.extra-substituters = [ "https://devenv.cachix.org" ];
settings.extra-platforms = [
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];

gc.automatic = true;

linux-builder = {
enable = true;
ephemeral = true;
maxJobs = 4;
config = {
virtualisation = {
darwin-builder = {
diskSize = 40 * 1024;
memorySize = 8 * 1024;
diskSize = 80 * 1024;
memorySize = 32 * 1024;
};
cores = 6;
};
Expand Down
2 changes: 0 additions & 2 deletions config/nushell/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
lib,
config,
pkgs,
pkgs-unstable,
...
}:
{
config = {
programs.nushell = {
enable = true;
package = pkgs-unstable.nushell;

envFile.text = (builtins.readFile ./env.nu);
configFile.text = (builtins.readFile ./config.nu);
Expand Down
19 changes: 18 additions & 1 deletion config/ssh/home.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
{ ... }:
{
lib,
pkgs,
config,
...
}:
{
options = {
programs.ssh.enable1PasswordAgent = lib.mkOption {
description = "Enable 1Password agent";
type = lib.types.bool;
default = false;
};
};

config.programs.ssh = {
enable = true;

forwardAgent = true;
hashKnownHosts = true;
addKeysToAgent = "yes";

extraConfig = lib.mkIf (
pkgs.stdenv.isDarwin && config.programs.ssh.enable1PasswordAgent
) "IdentityAgent \"~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock\"";
};
}
27 changes: 0 additions & 27 deletions config/terminfo/nixos.nix

This file was deleted.

3 changes: 1 addition & 2 deletions config/tools/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
config,
lib,
pkgs,
pkgs-unstable,
...
}:
let
Expand All @@ -11,7 +10,7 @@ let
pkgSet = enable: packages: if enable then packages else { };
defaultPackages =
{
inherit (pkgs-unstable)
inherit (pkgs)
lsd
tree
ripgrep
Expand Down
17 changes: 14 additions & 3 deletions config/vscode/home.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{ lib, pkgs-unstable, ... }:
{
lib,
pkgs,
config,
...
}:
{
config.programs.vscode = {
enable = true;

package = pkgs-unstable.vscodium;
package = pkgs.vscodium;

enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
Expand All @@ -12,7 +17,7 @@
userSettings = (lib.importJSON ./settings.json);
keybindings = (lib.importJSON ./keybindings.json);

extensions = with pkgs-unstable.vscode-extensions; [
extensions = with pkgs.vscode-extensions; [
zhuangtongfa.material-theme
mkhl.direnv
editorconfig.editorconfig
Expand All @@ -23,4 +28,10 @@
tamasfe.even-better-toml
];
};

config.home.packages = [
(pkgs.writeShellScriptBin "code" ''
${config.programs.vscode.package}/Applications/VSCodium.app/Contents/MacOS/Electron $@
'')
];
}
4 changes: 1 addition & 3 deletions config/zoxide/home.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{ ... }:
{
config.programs.zoxide = {
programs.zoxide = {
enable = true;
options = [ "--cmd cd" ];
};
}
Loading

0 comments on commit 4e09431

Please sign in to comment.