Compare commits
2 commits
38c7afa96f
...
7b38456c37
Author | SHA1 | Date | |
---|---|---|---|
Natsu Kagami | 7b38456c37 | ||
Natsu Kagami | 509b44a31b |
|
@ -1,82 +0,0 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
homebrew.enable = true;
|
||||
homebrew.brewPrefix =
|
||||
if pkgs.stdenv.isAarch64 then "/opt/homebrew/bin"
|
||||
else "/usr/local/bin";
|
||||
homebrew.onActivation.cleanup = "zap";
|
||||
homebrew.onActivation.upgrade = true;
|
||||
|
||||
# All needed taps
|
||||
homebrew.taps = [
|
||||
"homebrew/bundle"
|
||||
"homebrew/cask"
|
||||
"homebrew/core"
|
||||
"homebrew/services"
|
||||
];
|
||||
|
||||
homebrew.brews = [
|
||||
# CLI tools
|
||||
"pinentry-mac" # UI for Pin Entry on gpg Mac
|
||||
|
||||
{
|
||||
name = "d-bus";
|
||||
restart_service = "changed";
|
||||
}
|
||||
|
||||
# U2F
|
||||
"pam-u2f"
|
||||
];
|
||||
|
||||
homebrew.casks = [
|
||||
"blackhole-2ch"
|
||||
"finicky"
|
||||
"inkscape"
|
||||
"yt-music"
|
||||
"eloston-chromium"
|
||||
|
||||
# CLI, but doesn't yet work on Nix
|
||||
# "sage"
|
||||
];
|
||||
|
||||
# We don't really need to keep track of all these
|
||||
homebrew.masApps = {
|
||||
# # Safari Extensions
|
||||
# "Keepa - Price Tracker" = 1533805339;
|
||||
# "Vimari" = 1480933944;
|
||||
# "Bitwarden" = 1352778147;
|
||||
# "Save to Pocket" = 1477385213;
|
||||
# "AdGuard for Safari" = 1440147259;
|
||||
# "Refined GitHub" = 1519867270;
|
||||
|
||||
# # Productivity
|
||||
# # "GoodNotes" = 1444383602;
|
||||
# "Amphetamine" = 937984704; # Turns off auto display dimming and sleep for some time
|
||||
# "Session Pal" = 1515213004;
|
||||
# "Flow" = 1423210932;
|
||||
# # "Taskheat" = 1431995750; # Always shown outdated!
|
||||
# "Hidden Bar" = 1452453066;
|
||||
|
||||
# # Development
|
||||
# "Developer" = 640199958;
|
||||
# # "Xcode" = 497799835;
|
||||
|
||||
# # Chat
|
||||
# "Messenger" = 1480068668;
|
||||
# "LINE" = 539883307;
|
||||
# "Slack" = 803453959;
|
||||
|
||||
# # Office
|
||||
# "Keynote" = 409183694;
|
||||
# "Microsoft Excel" = 462058435;
|
||||
# "The Unarchiver" = 425424353;
|
||||
# "Numbers" = 409203825;
|
||||
# "Pages" = 409201541;
|
||||
# ## Multimedia
|
||||
# "DaVinci Resolve" = 571213070;
|
||||
# "GarageBand" = 682658836;
|
||||
# "iMovie" = 408981434;
|
||||
};
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../modules/personal/fonts
|
||||
./brew.nix
|
||||
];
|
||||
# List packages installed in system profile. To search by name, run:
|
||||
# $ nix-env -qaP | grep wget
|
||||
environment.systemPackages =
|
||||
with pkgs; [ podman qemu ];
|
||||
|
||||
environment.shells = with pkgs; [ fish ];
|
||||
|
||||
# Use a custom configuration.nix location.
|
||||
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
|
||||
# environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
|
||||
|
||||
# Auto upgrade nix package and the daemon service.
|
||||
# services.nix-daemon.enable = true;
|
||||
|
||||
# Create /etc/bashrc that loads the nix-darwin environment.
|
||||
programs.zsh.enable = true; # default shell on catalina
|
||||
programs.fish.enable = true;
|
||||
|
||||
## Networking related settings
|
||||
networking.hostName = "nki-macbook";
|
||||
|
||||
environment.variables = {
|
||||
EDITOR = ""; # don't set it by default
|
||||
|
||||
# Homebrew stuff
|
||||
# LLVM!
|
||||
# To use the bundled libc++ please add the following LDFLAGS:
|
||||
LDFLAGS = lib.concatStringsSep " " [
|
||||
"-L/opt/homebrew/opt/llvm/lib"
|
||||
"-Wl,-rpath,/opt/homebrew/opt/llvm/lib"
|
||||
"-L/opt/homebrew/opt/llvm/lib"
|
||||
"$LDFLAGS"
|
||||
];
|
||||
CPPFLAGS = "-I/opt/homebrew/opt/llvm/include $CPPFLAGS";
|
||||
};
|
||||
|
||||
environment.systemPath = lib.mkBefore [
|
||||
# Missing from MacOS
|
||||
"/usr/local/bin"
|
||||
# LaTeX
|
||||
"/usr/local/texlive/2021/bin/universal-darwin"
|
||||
# Go
|
||||
"/usr/local/go/bin"
|
||||
# Ruby
|
||||
"/opt/homebrew/opt/ruby@2.7/bin"
|
||||
# .NET
|
||||
"/usr/local/share/dotnet"
|
||||
# LLVM!
|
||||
"/opt/homebrew/opt/llvm/bin"
|
||||
];
|
||||
|
||||
# Used for backwards compatibility, please read the changelog before changing.
|
||||
# $ darwin-rebuild changelog
|
||||
system.stateVersion = 4;
|
||||
|
||||
# Font configuration
|
||||
|
||||
users.users.nki = {
|
||||
name = "nki";
|
||||
home = "/Users/nki";
|
||||
shell = "${config.home-manager.users.nki.programs.fish.package}/bin/fish";
|
||||
};
|
||||
}
|
76
flake.lock
76
flake.lock
|
@ -188,27 +188,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1696360011,
|
||||
"narHash": "sha256-HpPv27qMuPou4acXcZ8Klm7Zt0Elv9dgDvSJaomWb9Y=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "8b6ea26d5d2e8359d06278364f41fbc4b903b28a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lnl7",
|
||||
"ref": "master",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"deploy-rs": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_4",
|
||||
|
@ -350,21 +329,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_6": {
|
||||
"locked": {
|
||||
"lastModified": 1688025799,
|
||||
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "flake-compat",
|
||||
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
|
@ -955,28 +919,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-m1": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_6",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": "rust-overlay_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1700436815,
|
||||
"narHash": "sha256-+txRDmFuI/dW/ZmacfDrqSsKiWTNLmRygej25u2ojNM=",
|
||||
"owner": "tpwrules",
|
||||
"repo": "nixos-apple-silicon",
|
||||
"rev": "14b327ca47703c376ebb82ba16dc42ca2baa57d8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "tpwrules",
|
||||
"repo": "nixos-apple-silicon",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1688322751,
|
||||
|
@ -1288,7 +1230,6 @@
|
|||
"arion": "arion",
|
||||
"conduit": "conduit",
|
||||
"crane": "crane_3",
|
||||
"darwin": "darwin",
|
||||
"deploy-rs": "deploy-rs",
|
||||
"dtth-phanpy": "dtth-phanpy",
|
||||
"flake-utils": "flake-utils_5",
|
||||
|
@ -1301,7 +1242,6 @@
|
|||
"mpd-mpris": "mpd-mpris",
|
||||
"nix-gaming": "nix-gaming",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixos-m1": "nixos-m1",
|
||||
"nixpkgs": "nixpkgs_9",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"nur": "nur",
|
||||
|
@ -1378,22 +1318,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rust-overlay_3": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1686795910,
|
||||
"narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"scenefx": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_10"
|
||||
|
|
27
flake.nix
27
flake.nix
|
@ -5,8 +5,6 @@
|
|||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
nixos-hardware.url = "github:nixos/nixos-hardware";
|
||||
darwin.url = "github:lnl7/nix-darwin/master";
|
||||
darwin.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
home-manager-unstable.url = "github:nix-community/home-manager";
|
||||
|
@ -52,15 +50,13 @@
|
|||
kakoune.flake = false;
|
||||
kak-lsp.url = github:kakoune-lsp/kakoune-lsp;
|
||||
kak-lsp.flake = false;
|
||||
nixos-m1.url = github:tpwrules/nixos-apple-silicon;
|
||||
nixos-m1.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# ---
|
||||
# DEPLOYMENT ONLY! secrets
|
||||
secrets.url = "git+ssh://git@github.com/natsukagami/nix-deploy-secrets";
|
||||
};
|
||||
|
||||
outputs = { self, darwin, nixpkgs, nixpkgs-unstable, home-manager, deploy-rs, sops-nix, nur, ... }@inputs:
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, deploy-rs, sops-nix, nur, ... }@inputs:
|
||||
let
|
||||
overlays = import ./overlay.nix inputs;
|
||||
lib = nixpkgs.lib;
|
||||
|
@ -142,21 +138,6 @@
|
|||
packages.x86_64-linux.deploy-rs = deploy-rs.packages.x86_64-linux.default;
|
||||
apps.x86_64-linux.deploy-rs = deploy-rs.apps.x86_64-linux.default;
|
||||
|
||||
# MacBook configuration: nix-darwin + home-manager
|
||||
darwinConfigurations."nki-macbook" = darwin.lib.darwinSystem rec {
|
||||
system = "aarch64-darwin";
|
||||
modules = [
|
||||
(common-nix nixpkgs-unstable)
|
||||
./darwin/configuration.nix
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.nki = import ./home/macbook-home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Home configuration
|
||||
nixosConfigurations."kagamiPC" = mkPersonalSystem nixpkgs-unstable "x86_64-linux" {
|
||||
configuration = ./nki-home/configuration.nix;
|
||||
|
@ -196,12 +177,6 @@
|
|||
})
|
||||
];
|
||||
};
|
||||
# macbook nixos
|
||||
nixosConfigurations."kagami-air-m1" = mkPersonalSystem nixpkgs "aarch64-linux" {
|
||||
configuration = ./kagami-air-m1/configuration.nix;
|
||||
homeManagerUsers.nki = import ./home/macbook-nixos.nix;
|
||||
extraModules = [ inputs.nixos-m1.nixosModules.apple-silicon-support ];
|
||||
};
|
||||
|
||||
# DigitalOcean node
|
||||
nixosConfigurations."nki-personal-do" = mkPersonalSystem nixpkgs "x86_64-linux" {
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home.username = "nki";
|
||||
home.homeDirectory = "/Users/nki";
|
||||
|
||||
# Additional packages to be used only on this MacBook.
|
||||
home.packages = with pkgs; [
|
||||
anki-bin
|
||||
];
|
||||
|
||||
# Additional settings for programs
|
||||
programs.fish.shellAliases = {
|
||||
brew64 = "arch -x86_64 /usr/local/bin/brew";
|
||||
};
|
||||
nki.programs.kitty.enable = true;
|
||||
nki.programs.kitty.package = pkgs.hello; # We install kitty for ourselves
|
||||
nki.programs.kitty.background = ./images/chise-bg.png;
|
||||
|
||||
home.sessionPath = [
|
||||
# Personal .bin
|
||||
"$HOME/.bin"
|
||||
"$HOME/.local/bin"
|
||||
|
||||
# Rust
|
||||
"$HOME/.cargo/bin"
|
||||
# Haskell
|
||||
"$HOME/.cabal/bin"
|
||||
"$HOME/.ghcup/bin"
|
||||
# Go
|
||||
"$HOME/go/bin"
|
||||
# Node.js
|
||||
"$HOME/.local/opt/node/bin"
|
||||
# Ruby
|
||||
"$HOME/.gem/bin"
|
||||
"$HOME/.gem/ruby/2.7.0/bin"
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
VISUAL = "$EDITOR";
|
||||
|
||||
# Other C++ stuff
|
||||
LIBRARY_PATH = lib.concatStringsSep ":" [
|
||||
"$LIBRARY_PATH"
|
||||
"$HOME/.local/share/lib"
|
||||
];
|
||||
CPATH = lib.concatStringsSep ":" [
|
||||
"$CPATH"
|
||||
"$HOME/.local/share/include"
|
||||
];
|
||||
|
||||
# Ruby
|
||||
GEM_HOME = "$HOME/.gem";
|
||||
|
||||
# .NET
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT = "true";
|
||||
|
||||
# Override home-manager package path to first
|
||||
PATH = "/etc/profiles/per-user/${config.home.username}/bin:$PATH";
|
||||
};
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
# when a new Home Manager release introduces backwards
|
||||
# incompatible changes.
|
||||
#
|
||||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
home.stateVersion = "21.11";
|
||||
}
|
|
@ -1,132 +0,0 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
discord = pkgs.armcord.override { nss = pkgs.nss_latest; };
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Common configuration
|
||||
./common.nix
|
||||
# We use our own firefox
|
||||
# ./firefox.nix
|
||||
# osu!
|
||||
# ./osu.nix
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home.username = "nki";
|
||||
home.homeDirectory = "/home/nki";
|
||||
|
||||
nki.programs.kitty.enable = true;
|
||||
nki.programs.kitty.fontSize = 16;
|
||||
programs.fish.shellInit = lib.mkAfter ''
|
||||
set -eg MESA_GL_VERSION_OVERRIDE
|
||||
set -eg MESA_GLSL_VERSION_OVERRIDE
|
||||
|
||||
# export GNOME_KEYRING_CONTROL=/run/user/1001/keyring
|
||||
# export SSH_AUTH_SOCK=/run/user/1001/keyring/ssh
|
||||
'';
|
||||
|
||||
# More packages
|
||||
home.packages = (with pkgs; [
|
||||
# CLI stuff
|
||||
python3
|
||||
zip
|
||||
# TeX
|
||||
texlive.combined.scheme-full
|
||||
mate.mate-terminal
|
||||
|
||||
firefox-wayland
|
||||
|
||||
discord
|
||||
|
||||
typora
|
||||
]);
|
||||
|
||||
# Graphical set up
|
||||
linux.graphical.type = "wayland";
|
||||
linux.graphical.wallpaper = ./images/wallpaper-macbook.jpg;
|
||||
# Enable sway
|
||||
programs.my-sway.enable = true;
|
||||
programs.my-sway.fontSize = 14.0;
|
||||
programs.my-sway.enableLaptopBars = true;
|
||||
programs.my-sway.enableMpd = false;
|
||||
programs.my-sway.discord = "${discord}/bin/armcord";
|
||||
# Keyboard options
|
||||
wayland.windowManager.sway.config.input."type:keyboard".xkb_layout = "jp";
|
||||
wayland.windowManager.sway.config.output."eDP-1" = {
|
||||
mode = "2560x1600@60Hz";
|
||||
scale = "1.25";
|
||||
subpixel = "vrgb";
|
||||
};
|
||||
wayland.windowManager.sway.config.input."1452:641:Apple_Internal_Keyboard_/_Trackpad" = {
|
||||
# Keyboard stuff
|
||||
xkb_layout = "jp";
|
||||
repeat_delay = "300";
|
||||
repeat_rate = "15";
|
||||
# Trackpad stuff
|
||||
accel_profile = "adaptive";
|
||||
drag = "enabled";
|
||||
dwt = "enabled";
|
||||
middle_emulation = "enabled";
|
||||
natural_scroll = "enabled";
|
||||
scroll_factor = "2.5";
|
||||
pointer_accel = "0.5";
|
||||
tap = "disabled";
|
||||
};
|
||||
|
||||
# Kitty
|
||||
# nki.programs.kitty = {
|
||||
# enable = true;
|
||||
# fontSize = 22;
|
||||
# enableTabs = false;
|
||||
# };
|
||||
|
||||
# Yellow light!
|
||||
services.wlsunset = {
|
||||
enable = true;
|
||||
# # Waterloo
|
||||
# latitude = "43.3";
|
||||
# longitude = "-80.3";
|
||||
|
||||
# Lausanne
|
||||
latitude = "46.31";
|
||||
longitude = "6.38";
|
||||
};
|
||||
|
||||
home.file.".gnupg/gpg-agent.conf" = {
|
||||
text = ''
|
||||
pinentry-program ${pkgs.pinentry-gnome3}/bin/pinentry-gnome3
|
||||
'';
|
||||
onChange = ''
|
||||
echo "Reloading gpg-agent"
|
||||
echo RELOADAGENT | gpg-connect-agent
|
||||
'';
|
||||
};
|
||||
|
||||
# Autostart
|
||||
xdg.configFile."autostart/input-remapper-autoload.desktop".source =
|
||||
"${pkgs.input-remapper}/share/applications/input-remapper-autoload.desktop";
|
||||
|
||||
# Multiple screen setup
|
||||
# services.kanshi = {
|
||||
# enable = true;
|
||||
# profiles.undocked.outputs = [{ criteria = "LVDS-1"; }];
|
||||
# profiles.docked-hdmi.outputs = [
|
||||
# { criteria = "LVDS-1"; status = "disable"; }
|
||||
# { criteria = "HDMI-A-1"; }
|
||||
# ];
|
||||
# };
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
# when a new Home Manager release introduces backwards
|
||||
# incompatible changes.
|
||||
#
|
||||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
home.stateVersion = "21.05";
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
cfg = config.nki.programs.kitty;
|
||||
cmd = "cmd";
|
||||
in
|
||||
with lib; {
|
||||
programs.kitty = mkIf (cfg.enable && pkgs.stdenv.isDarwin) {
|
||||
|
||||
# Darwin-specific setup
|
||||
darwinLaunchOptions = [
|
||||
"--single-instance"
|
||||
"--start-as=fullscreen"
|
||||
];
|
||||
|
||||
# Tabs and layouts keybindings
|
||||
keybindings = {
|
||||
# Backslash
|
||||
"0x5d" = "send_text all \\u005c";
|
||||
};
|
||||
|
||||
settings = {
|
||||
# MacOS specific
|
||||
macos_option_as_alt = "left";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
let
|
||||
cfg = config.nki.programs.kitty;
|
||||
cmd = if pkgs.stdenv.isDarwin then "cmd" else "ctrl";
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
imports = [ ./darwin.nix ./linux.nix ./tabs.nix ];
|
||||
imports = [ ./linux.nix ./tabs.nix ];
|
||||
|
||||
options.nki.programs.kitty = {
|
||||
enable = mkEnableOption "Enable kitty";
|
||||
|
|
|
@ -1,148 +0,0 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
# Fonts
|
||||
../modules/personal/fonts
|
||||
# Encrypted DNS
|
||||
../modules/services/edns
|
||||
# Override base mesa
|
||||
({ ... }: { nixpkgs.overlays = lib.mkBefore [ (final: prev: { mesa = prev.mesa.override { enableOpenCL = true; meson = final.unstable.meson; }; }) ]; })
|
||||
];
|
||||
|
||||
# time.timeZone = lib.mkForce "Asia/Ho_Chi_Minh";
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
|
||||
|
||||
# Asahi kernel configuration
|
||||
hardware.asahi = {
|
||||
peripheralFirmwareDirectory = ./firmware;
|
||||
use4KPages = false;
|
||||
withRust = true;
|
||||
addEdgeKernelConfig = true;
|
||||
useExperimentalGPUDriver = true;
|
||||
experimentalGPUInstallMode = "overlay";
|
||||
};
|
||||
# Override mesa
|
||||
nixpkgs.overlays = lib.mkAfter [
|
||||
(final: prev: {
|
||||
mesa-asahi-edge = prev.mesa-asahi-edge.overrideAttrs (attrs: {
|
||||
version = "24.0.0";
|
||||
# buildInputs = attrs.buildInputs ++ (with pkgslw; [ libclc cmake (spirv-llvm-translator.override { inherit (llvmPackages_15) llvm; }) ]);
|
||||
# nativeBuildInputs = attrs.nativeBuildInputs ++ (with pkgs; [ pkgs.unstable.spirv-llvm-translator ]);
|
||||
src = final.fetchFromGitLab {
|
||||
# latest release
|
||||
domain = "gitlab.freedesktop.org";
|
||||
owner = "asahi";
|
||||
repo = "mesa";
|
||||
rev = "asahi-20231121";
|
||||
hash = "sha256-IcKKe1RA8sCaUfWK71ELzF15YaBS3DjoYhNMIWiQ5Jw=";
|
||||
};
|
||||
|
||||
patches = lib.forEach attrs.patches (p:
|
||||
if lib.hasSuffix "opencl.patch" p
|
||||
then ./mesa-asahi-edge/opencl.patch else p);
|
||||
});
|
||||
})
|
||||
];
|
||||
## Additional mesa-related packages
|
||||
environment.systemPackages = with pkgs; [ SDL2 ];
|
||||
|
||||
# Power Management
|
||||
services.upower = {
|
||||
enable = true;
|
||||
criticalPowerAction = "PowerOff";
|
||||
|
||||
usePercentageForPolicy = true;
|
||||
percentageCritical = 3;
|
||||
percentageLow = 10;
|
||||
};
|
||||
services.logind.lidSwitch = "suspend";
|
||||
|
||||
# Printing
|
||||
services.printing.drivers = with pkgs; [ epfl-cups-drivers ];
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
services.xserver.libinput.enable = true;
|
||||
# Keyboard
|
||||
services.input-remapper.enable = true;
|
||||
services.input-remapper.serviceWantedBy = [ "multi-user.target" ];
|
||||
hardware.uinput.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
common.linux.username = "nki";
|
||||
|
||||
# Enable sway on login.
|
||||
environment.loginShellInit = ''
|
||||
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||
exec sway
|
||||
fi
|
||||
'';
|
||||
|
||||
# Networking
|
||||
common.linux.networking = {
|
||||
hostname = "kagami-air-m1";
|
||||
networks."10-wired".match = "enp*";
|
||||
networks."20-wireless".match = "wlan*";
|
||||
dnsServers = [ "127.0.0.1" ];
|
||||
};
|
||||
nki.services.edns.enable = true;
|
||||
nki.services.edns.ipv6 = true;
|
||||
|
||||
# Secrets
|
||||
sops.defaultSopsFile = ./secrets.yaml;
|
||||
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
|
||||
## tinc
|
||||
sops.secrets."tinc/ed25519-private-key" = { };
|
||||
services.my-tinc = {
|
||||
enable = true;
|
||||
hostName = "macbooknix";
|
||||
ed25519PrivateKey = config.sops.secrets."tinc/ed25519-private-key".path;
|
||||
bindPort = 6565;
|
||||
};
|
||||
|
||||
services.dbus.packages = with pkgs; [ gcr ];
|
||||
|
||||
# Power Management
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
# powerDownCommands = ''
|
||||
# /run/current-system/sw/bin/rmmod brcmfmac # Disable wifi
|
||||
# /run/current-system/sw/bin/rmmod hci_bcm4377 # Disable bluetooth
|
||||
# '';
|
||||
# resumeCommands = ''
|
||||
# /run/current-system/sw/bin/modprobe brcmfmac # Enable wifi
|
||||
# /run/current-system/sw/bin/modprobe hci_bcm4377 # Enable bluetooth
|
||||
# /run/current-system/sw/bin/systemctl restart iwd
|
||||
# /run/current-system/sw/bin/systemctl restart bluetooth
|
||||
# '';
|
||||
};
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
# accidentally delete configuration.nix.
|
||||
# system.copySystemConfiguration = true;
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "22.05"; # Did you read the comment?
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
mkdir -p firmware && cp /boot/asahi/{all_firmware.tar.gz,kernelcache*} firmware
|
Binary file not shown.
Binary file not shown.
|
@ -1,35 +0,0 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "usb_storage" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{
|
||||
device = "/dev/disk/by-uuid/ebb6bf2e-2d7f-4fa6-88cb-751fdd174ef9";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{
|
||||
device = "/dev/disk/by-uuid/19BC-1BE8";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/swap"; size = 16 * 1024; }
|
||||
];
|
||||
|
||||
# nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
diff --git a/meson.build b/meson.build
|
||||
index 04d89987311..babfe440973 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -1812,7 +1812,7 @@ endif
|
||||
|
||||
dep_clang = null_dep
|
||||
if with_clc
|
||||
- llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
|
||||
+ llvm_libdir = get_option('clang-libdir')
|
||||
|
||||
dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
|
||||
|
||||
diff --git a/meson_options.txt b/meson_options.txt
|
||||
index e885ba61a8a..29ce0270479 100644
|
||||
--- a/meson_options.txt
|
||||
+++ b/meson_options.txt
|
||||
@@ -1,6 +1,12 @@
|
||||
# Copyright © 2017-2019 Intel Corporation
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
+option(
|
||||
+ 'clang-libdir',
|
||||
+ type : 'string',
|
||||
+ value : '',
|
||||
+ description : 'Locations to search for clang libraries.'
|
||||
+)
|
||||
option(
|
||||
'platforms',
|
||||
type : 'array',
|
||||
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
|
||||
index 7c14135898e..74dc6850603 100644
|
||||
--- a/src/gallium/targets/opencl/meson.build
|
||||
+++ b/src/gallium/targets/opencl/meson.build
|
||||
@@ -39,7 +39,8 @@ if dep_llvm.version().version_compare('>=10.0.0')
|
||||
polly_isl_dep = cpp.find_library('PollyISL', dirs : llvm_libdir, required : false)
|
||||
endif
|
||||
|
||||
-dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
|
||||
+clang_libdir = get_option('clang-libdir')
|
||||
+dep_clang = cpp.find_library('clang-cpp', dirs : clang_libdir, required : false)
|
||||
|
||||
# meson will return clang-cpp from system dirs if it's not found in llvm_libdir
|
||||
linker_rpath_arg = '-Wl,--rpath=@0@'.format(llvm_libdir)
|
||||
@@ -123,7 +124,7 @@ if with_opencl_icd
|
||||
configuration : _config,
|
||||
input : 'mesa.icd.in',
|
||||
output : 'mesa.icd',
|
||||
- install : true,
|
||||
+ install : false,
|
||||
install_tag : 'runtime',
|
||||
install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
|
||||
)
|
||||
diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build
|
||||
index b2963fe6dfa..99d6d801b94 100644
|
||||
--- a/src/gallium/targets/rusticl/meson.build
|
||||
+++ b/src/gallium/targets/rusticl/meson.build
|
||||
@@ -76,7 +76,7 @@ configure_file(
|
||||
configuration : _config,
|
||||
input : 'rusticl.icd.in',
|
||||
output : 'rusticl.icd',
|
||||
- install : true,
|
||||
+ install : false,
|
||||
install_tag : 'runtime',
|
||||
install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
|
||||
)
|
|
@ -1,31 +0,0 @@
|
|||
tinc:
|
||||
ed25519-private-key: ENC[AES256_GCM,data:Cc86FPxUK+MEHTDKtbSOb4WE8WrK9sPI5fQ0oyYPkLzKqn0ZeHlTyeXZD9THTWDyW9Ky5q0rIk7HxjFkLZMid5x3d/EcovSvpx2dyIzYGX2EiVfAbkF4v2JqXrnfdF/EQSF+Z9G6P2elPdXlXu7dUEqe3XsFFdKwe80EIzItO+b3BE3P3Xt9NxbkCRj3zHSuVlt5v81WzLkUTtPLwOcQafwrZ3Engi9Yrjyh58ufGYQyBItTdwlKblv42XahiOqhJ8QXBGiMCFY=,iv:h88X3PT/G1QV4GcD07IvLcMyM7WLRMuBMMYQ6Z1YOgE=,tag:aK2dCizwThbJt8woLKS9UQ==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age169v95f5fqx0sg5mjpp63sumrj9sma9se203ra2c05qa67h2h2drs3tvdph
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBHQ0ZFampRSm5BbTVpUk9o
|
||||
MUhLenM0czVDM1NUWFFsTGxZUllKMjNOU3pZCm00eUZjRFU3bTZnbnNVR2RnMVl2
|
||||
UEV2c1VXNDRhRklIZmpnN2dLczJPVGcKLS0tIGVlTkkrWXVTbFVJS1h4YnZRKzNn
|
||||
dFJYaEErRWFJZXpnWVY1dk4zbnMxK3cKZ0aiD0ZusCWnjfhEsuVNO8XZrwupDANu
|
||||
GUf03lwpLiOx6OehK2wR0pfMEfmbDOP6+o673Sw9PcreEPvUovh82Q==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
- recipient: age10dd4t507h3ey68l2alu7z94s5lw0kshjq9lre5sv2vehrm9hg4rqk2let7
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAraHhUUXlpb3UvNWdkc3ZP
|
||||
bFdNU0NaaStxR2c4SEY2NFByKzVGa1BkWXpjCmVlMmF3eUdid3RSMjVTUlJOM0hS
|
||||
eHByVGtiUzBEZGRVRjg1TENPQlpPNjQKLS0tIG11cWFUU3JNeFY4cCt3d2ZUWmpl
|
||||
dnZKYUIvM1N2eGFubkgzdUVESEVCYm8KGIEl6MKIc7Xsg9MePOgLovSBWh7b0BX/
|
||||
aUXZm+elav6a7dmPSXqA7/ZSUtxZqD3sYF06YnABEhO+wQ5McArkFg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2022-10-17T11:24:18Z"
|
||||
mac: ENC[AES256_GCM,data:nJLJXWvJpZRzvDuIiXiFQE2V4IYKtkFLR0U0KnTz7V9e/k+i4x53rMf8HuvKCxbWiJl/YdmxAEj0j+K8UPQv2G5OCG84qO0AUUXik2rHsd8WAv3EweS9WWSu0lgzf5U9ZdUuwZacmoU2khDmfXeZ5NTF/+eVDSDp3hZ+hTiJDFM=,iv:iEW9jecRfiT7vLYffNsFSI4wE/Ok5aNjOZfV1dTtt5Q=,tag:Gw7VpSbn17O75jNN3t8deg==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.7.3
|
|
@ -12,14 +12,4 @@
|
|||
rsaPublicKey = builtins.readFile ./nki-home.pub;
|
||||
ed25519PublicKey = "Ts5OdPtBNLIRfosoYRcb6Z2iwWyOz/VKTKB9J0p5LlH";
|
||||
};
|
||||
|
||||
macbook = {
|
||||
subnetAddr = "11.0.0.3";
|
||||
rsaPublicKey = builtins.readFile ./nki-macbook.pub;
|
||||
ed25519PublicKey = "lkNkBTl5GmcQFrtA7F1nN2gq5gFK7KuGqHUN8fiJU7H";
|
||||
};
|
||||
macbooknix = {
|
||||
subnetAddr = "11.0.0.4";
|
||||
ed25519PublicKey = "6MN5LVE4juavv8qJW2dTN4t/haKCADWquAQj/ADF7iN";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -102,9 +102,7 @@ let
|
|||
in
|
||||
final.libs.crane.buildPackage {
|
||||
inherit src cargoArtifacts;
|
||||
buildInputs = (with final;
|
||||
lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security SystemConfiguration CoreServices ])
|
||||
) ++ (with final; [ libiconv ]);
|
||||
buildInputs = with final; [ libiconv ];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -135,8 +133,6 @@ let
|
|||
(builtins.abort "no support for non-aarch64-linux")
|
||||
(final.callPackage ./packages/aarch64-linux/typora.nix { });
|
||||
};
|
||||
|
||||
overlay-asahi = inputs.nixos-m1.overlays.default;
|
||||
in
|
||||
[
|
||||
inputs.swayfx.overlays.default
|
||||
|
@ -150,7 +146,6 @@ in
|
|||
overlay-imported
|
||||
overlay-versioning
|
||||
overlay-libs
|
||||
overlay-asahi
|
||||
overlay-aarch64-linux
|
||||
nur.overlay
|
||||
|
||||
|
|
Loading…
Reference in a new issue